There is a very similar previous question and answer, but for windows 7 and/or earlier versions of Google Chrome, here:
That solution no longer seems to work on Windows 8 (x64) and Chrome (2013-03-19, v25.0.1364.172). I have modified the hosts file, restarted, and yet there is still a very noticeable delay when refreshing a localhost site using "localhost". There is no delay when using "127.0.0.1". There is no noticeable delay using either of these in firefox or IE.
There is also no noticeable delay when using the computer name. Only "localhost" incurs the delay.
Chrome's network internals page: "chrome://net-internals/dns#dns" indicates ipv6 is already disabled (and there is no button to enable).
1) What is so different about localhost handling in the network stack for Chrome/Windows?
2) Are there newer options for recent Chrome versions & Windows 8 to force chrome to use ipv4 instead of ipv6 when accessing the loopback interface?
EDIT: I uploaded a short video showing the differences here: http://youtu.be/UyS62gKk3Xw . In the video I first reload using localhost three times. I then switch to 127.0.0.1 and reload three times. Then switch back. When using localhost, the reloads consistently take ~1.4 seconds. When using 127.0.0.1, the reloads only take ~500 ms. The hosts file maps 127.0.0.1 to localhost and the ip6 mapping is commented out. It seems to make no difference if I hold shift key while reloading.
Relevant lines in hosts file:
#localhost name resolution is handled within DNS itself.
127.0.0.1 localhost
# ::1 localhost
Note that the first commented line is in the hosts file on Windows 8 by default. I don't remember it being there in previous versions, but maybe it was.