markstewie
markstewie

Reputation: 9587

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?

Upvotes: 4

Views: 9206

Answers (4)

AndHeiberg
AndHeiberg

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:

  1. Open terminal and run "sudo apachectl stop"
  2. Change MAMP server ports to "default ports"
  3. Enjoy

Explanation:

  1. Stops apache from running on the machine. This is needed as we are setting MAMPS ports to the standard apache ports and therefore making a conflict.
  2. Change the actual ports

I don't yet now if this will fix the problem indefinitely, but time will tell.

Upvotes: 0

markstewie
markstewie

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

user481081
user481081

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

Matt Gibson
Matt Gibson

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

Related Questions