Running sites on "localhost" is extremely slow

Having real trouble using my localhost to test sites. It runs extremely slowly! Sometimes it takes up to a minute to load a page. I'm using Firefox and the sites I'm testing run fine on other developers in my office's local machines / on the production server.

I've gone through the normal things :-

  1. Disabled IPv6
  2. Not running in debug mode
  3. Put the site in the highest app pool (High Isolated) on IIS 6.
  4. Taking of firewalls etc.

The problem only seems to occur when hitting pages which contain some form of .net code in the code-behind.

Appreciate that this a little bit of a vague topic / stab in the dark but would appreciate any sort of advice - it's horrible waiting a minute each refresh to try out a change!

Cheers, Sean.


Solution 1:

I had the same problem with PHP. I solved it by changing "localhost" to "127.0.0.1" in database connection parameters like someone suggested here: https://serverfault.com/a/444338/62739 . I think it may work for you too, give it a try.

Solution 2:

Just Sharing my solution... i changed the url in my browser from localhost:port to 127.0.0.1:port which resulted in very fast loading

Solution 3:

I had same issues, edited my hosts file 127.0.0.1 localhost, but noticed no difference.

I then disabled Compression in the IIS panel and applied, and problem appears to now be resolved.

IIS Manager > Compression > Uncheck 'Enable dynamic content compression' and uncheck 'Enable static content compression'. Then 'Apply'.

Hope this helps!

regards, Geoff

Solution 4:

I was having the same issue, IIS initial loading would take up to 10 minutes instead of the usual 30 seconds.

I opened up Task Manager to see what processes were running. Turns out Windows Defender would spike at 30% CPU usage when hitting the IIS endpoint for the first time. I tried excluding my /bin/ folders but that did not work, so I just disabled real-time protection on Windows Defender and voilà the site was loading in just 30 seconds.

Solution 5:

Disable the antivirus on the folders where is the code of the web application. In my case I have observed a big improvement with Avast antivirus.