Fork me on GitHub

article

Beware MAMP’s default Caching Settings

March 14, 2011 | Computers, Web Design & Development

MAMP is a wonderful thing. It allows for quick setup of a LAMP stack just about anywhere. This makes it great for testing. However, the folks who manage MAMP are focusing MAMP’s default settings towards production use, not development use. This means that XCache is turned on by default and that means that there is variable caching and file-path caching going on (MAMP also includes the APC & EAccelerator extensions, which do very similar things, as well).

While enabling these caching settings is good for performance they’re not really good for development since both filesystem paths and interpreted code can be cached for periods of time. What made me notice was when a machine here in the office wasn’t honoring the new path to a renamed folder. The assets in this folder were all loaded via include statements using relative paths. Hard coded paths should not have been an issue, but for some reason the system kept looking for the files in their old location.

It took a while before I narrowed it down to the caching settings as a culprit. Once we turned off caching all together our changes were reflected immediately and all was right again with the world.

What you need to do

The modification is simple, its just a change to the MAMP preferences.

  1. Open MAMP
  2. Click the “Preferences” button or select “Preferences” from the MAMP menu
  3. Click on “PHP” in the tab-bar if its not already selected
  4. Change the “Cache” dropdown to be “––” so that no caching extension is used
  5. Click “OK” to save the changes
  6. Restart MAMP (click “Stop Servers” and then “Start Servers” once they’ve stopped)

3 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  • Lol, Thanks man, you saved my day, wasted like 1 hour, then it was the cache that did not show my jquery changes.

    Eddie, August 14, 2011 11:26 am | permalink

  • Thanks! Working on a CMS and MAMP 2.1.1 (apache) was crashing when it was on. Fixed!

    Jeremy, August 1, 2012 12:24 pm | permalink

Mentions

  1. MAMP server issue - PHP Solutions - Developers Q & A

    […] Above is extracted from here. […]

    October 23, 2013 | 11:03 pm

Comments are closed