Reputation: 9587
I can't work out why when viewing local sites that I've given a virtual (.dev) host name to are so slow in Firefox & Chrome... but not in Safari. It takes about 5 seconds to load each page in FF & C... but is absolutely instant every time in Safari.
Does anyone have any ideas I could try. It would be most appreciated?
Upvotes: 4
Views: 9206
Reputation: 1029
I won't try to comprehend why this is happening, as others are clearly more knowledgeable about this than me - see the other answer. However I think I have a fix.
The following methodology solved this problem for me:
Explanation:
I don't yet now if this will fix the problem indefinitely, but time will tell.
Upvotes: 0
Reputation: 9587
None of the above worked but this did!! At last....
To fix, in your hosts file you need to list all your local dev sites in a space delimited row like so...
127.0.0.1 localhost localsite1.dev localsite2.dev localsite3.dev
Instead of one entry on each line as is the default.
I don't know the technical reason why this works but it does. It's a huge relief after six months of having to debug websites outside of preferred browser.
Upvotes: 11
Reputation:
This is a bug with IPv6 and OSX; something Apple has acknowledged. You can google this as it's rather prevalent.
One solution which isn't universally effective is not using "local" as part of the custom DNS entry. ".dev" is the typical suggestion, but anything works. In Firefox, this works well, but Chrome still doesn't care.
In Firefox you can disable IPv6, which eliminates the problem entirely for that browser. Go to the URL about:config and in the search box enter "ipv6." There should be a single entry: network.dns.disableIPv6. Enable it. Restart the browswer. Done.
Note that PHPMyAdmin will not like this change. When you go through the MAMP startup page, it'll throw errors. I bypassed that by going straight to the source: http://localhost/phpMyAdmin/. Eventually, the issue went away.
Upvotes: 2
Reputation: 14949
I had this problem and got some speed increase by including ipv6 addresses in /etc/hosts like this:
127.0.0.1 6drudev.localhost
::1 6drudev.localhost
fe80::1%lo0 6drudev.localhost
127.0.0.1 7drudev.localhost
::1 7drudev.localhost
fe80::1%lo0 7drudev.localhost
YMMV of course.
Upvotes: 5