Alex Rivera | Logout

Firefox and Chrome slow on localhost; known fix doesn't work on Windows 7

Asked 2009-11-13T01:31:19.467
59

Firefox and Chrome are known to be slow on localhost when IP6 is enabled. In previous versions of Windows, the simplest fix is to comment out this line from the hosts file, as explained in the answer to this question.

::1 localhost

However, as noted in this question, in Windows 7 this line is already commented out:

# localhost name resolution is handled within DNS itself.
#   127.0.0.1 localhost
#   ::1 localhost

Is there an alternative way to disable the ::1 localhost reference in Windows 7?

Edit
Report

3 Answers

64

Turns out if you uncomment the 127.0.0.1 line in the hosts file, Chrome goes back to its snappy self on localhost URLs.

# localhost name resolution is handled within DNS itself.
    127.0.0.1 localhost

The hosts file is typically at C:\WINDOWS\system32\drivers\etc\hosts. To edit it in Win7, you'll need to run Notepad as administrator.

answered 2009-11-28T21:02:43.013
23

It turns out that the slowness is caused by an IPv6 issue with DNS and can easily be resolved by turning IPv6 support off in Firefox while doing localhost testing. To make the change, type

about:config 

in the address bar, locate the

network.dns.disableIPv6

setting and double-click on it to set it to true. This does the trick for the Firefox localhost issue on Vista and everything is running fast again.

http://kb.mozillazine.org/Network.dns.disableIPv6 has all the info you probably need - good luck!

answered 2009-11-13T01:37:47.957
0

As someone else noted in a different answer - if you have bitdefender, then that will merrily ruin your development experience.

Best to open the bit defender console, enter alt-shift-control-g (which puts it in "game mode") and run from there.

in game mode, bitdefender won't bollocks up your localhost!

answered 2012-06-05T03:12:21.737

Your Answer