I'm developing websites in a Windows 7 machine.

When I've installed Firefox I've found some performance issue specially on connecting to the localhost, googling around I've discovered that it's related to the use of IPv6 by the browser to resolve urls.

Using about: config and setting network.dns.disableIPv6 to true the problem is gone.

Now I've the same issue with Google Chrome, but I can't find a way (if there's a way) to do the same I've done with Firefox.

Any suggestions?

link|improve this question
7  
Have you tried fixing your systems IPv6 problem? – Brian Knoblauch Aug 11 '10 at 15:15
feedback

3 Answers

up vote 5 down vote accepted

From: http://stackoverflow.com/questions/1726585/firefox-and-chrome-slow-on-localhost-known-fix-doesnt-work-on-windows-7

Edit your "hosts" file on your computer to make sure there is an ipv4 style localhost entry there. Go to:

C:\Windows\System32\drivers\etc\hosts

Make sure there is a line that looks like

127.0.0.1       localhost

And make sure the line with the ipv6 style is commented out (with #)

#   ::1             localhost

You'll have to run your editor w/ admin mode to be able to save the changes. I had this problem before and this change fixed it for me. It doesn't disable ipv6 on your computer, it just tells it to use ipv4 for localhost lookups.

link|improve this answer
works fine, thanks! until chrome doesn't correctly support the disable of IPv6, I'll hold commented this line. – tanathos Aug 12 '10 at 6:58
That works fine, the problem is that some other systems on your machine might need that setting in the hosts file, i.e. the Team foundation server in my case. If I comment ::1 in the hosts file, TFS access is slow, and Chrome fast :( – Juri Nov 11 '11 at 7:33
feedback

Start Chrome with the command line flag --disable-ipv6

link|improve this answer
uhm... it seems to not work... I'm not sure, but the images on the page still loading very slow, one by one... on firefox, same machine, same website, it's really faster – tanathos Aug 11 '10 at 14:33
Yeah, I found that suggestion on some places but it seems to only be available in nightly builds or something like that... What about disabling IPv6 system wide? Do the Timeline and Profile tab under the Developer Tools (Ctrl+Shift+I) indicate something else going on? You found this to be an issue on Firefox, but on Chrome it might be unrelated... Chrome's proxy settings are inherited from Internet Explorer, maybe it might help to disable IPv6 over there? – Tom Wijsman Aug 11 '10 at 14:56
But I've tested this even with IE, and with IE is fast as with Firefox, if this was related to Internet Settings IE had to be slow... disable IPv6 at operating system level is my last resource :) – tanathos Aug 11 '10 at 15:19
1  
Worked fine for me with 9.0.597.107 – Martin v. Löwis Mar 1 '11 at 17:11
feedback

if you're running linux with Google Chrome or Chromium, you can do the same thing as suggested by Matt.

Edit your /etc/hosts file as root.

I commented out all ipv6 addresses ( any with a colon : ) and I'm getting faster page loads, may be coincidence, but I don't think so.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.