Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why are my MAMP PRO local dev sites slow in Firefox & Chrome?

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?

like image 236
markstewie Avatar asked Dec 01 '22 23:12

markstewie


2 Answers

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.

like image 82
markstewie Avatar answered Dec 24 '22 21:12

markstewie


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.

like image 44
Matt Gibson Avatar answered Dec 24 '22 20:12

Matt Gibson