Apache localhost intranet website running on LAN takes long to resolve host and load (Solved)

I had this situation where a Windows PC intranet website I deployed on a local apache server (using Xampp) which I shared on a local area network (LAN) was taking a long time to resolve/load. Often lasting up to 14+ seconds to load.

This was not good for user experience as every single refresh was taking that long.

I searched forever on the internet  and did not find a working solution.

Things I did that did not work include:

1. Optimizing apache (didn't work)
2. connected the server over cable instead of wireless (didn't work)

I noticed the website was fast when connected to the internet and also when the server was not connected to the network. I decided to use chrome inspect to see what error will pop up.

I saw an error "failed to connect to resource". That resource was a webfont by google namely fonts.googleapis.com and fonts.gstatic.com

Seeing this, I sought to block those url from with the hope that the application will default to the fallback fonts and not try to make a connection to the hosted fonts. So:

3. I downloaded http request and url blockers for chrome (seem to have worked but briefly).
4. I tried to block via the computers host file

Just when I had given up, I decided to locate the CSS that was requesting the webfont. I found a theme file css that had the line 

@import url("https://fonts.googleapis.com/css?family=Lato:400,700,400italic");

Solution

I removed the whole line of css code @import url("https://fonts.googleapis.com/css?family=Lato:400,700,400italic"); and saved the css file. After that I cleared browser cache and voila.

Comments

Popular posts from this blog

The Mysterious Subframe Bushings: When Your Vehicle Clunks And Swerves And You've Done It All With No Resolution.

Dusk To Dawn Photocell Wiring Guide - Automating Your Outdoor Light

Easy Step By Step Guide to Using Google NotebookLM - A Personalized Research Assistant.