Turn off Caching in MAMP
Asked Answered
V

3

18

Trying to turn off caching in MAMP for development, waiting for cache to expire after making small changes is killing my productivity. (Problem started when I changed to PHP 5.5.3, changing back doesn't fix it)

After researching I've taken the following steps to (unsuccessfully) disable cache:

Commented out OPcache lines in php.ini and reset mamp. (and tried zero values shown)

;zend_extension="/Applications/MAMP/bin/php/php5.5.3/lib/php/extensions/no-debug-non-zts-20121212/opcache.so"
;  opcache.memory_consumption=0
;  opcache.interned_strings_buffer=0
;  opcache.max_accelerated_files=0
;  opcache.revalidate_freq=0
;  opcache.fast_shutdown=1
;  opcache.enable_cli=0

added PHP headers

   header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
   header("Cache-Control: post-check=0, pre-check=0", false);
   header("Pragma: no-cache");

added html headers

<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />

I'm also using the option in google chrome to turn off caching when dev tools are open.

I'm lost here, can't think of anything else I can do to disable cache.

After changing PHP - OR - HTML code I have to wait about 2 mins for it to take effect. However database changes seem to take effect immediately so I think its a server side opcache.

Is there another cache that MAMP uses that I need to disable? (or a different step?)

Virelay answered 20/1, 2014 at 22:18 Comment(5)
It's been over a week, and not even a suggestion? Same problem here... @Philippe, just to make sure we're on the same page, ensure you commented out OPcache in /Applications/MAMP/bin/php/php5.5.3/conf/php.ini, not the one in /Applications/MAMP/conf/php5.5.3/php.ini. This is according to Husky's comment here: #19073770Edi
@IvanDurst I had commented it out here, /Applications/MAMP/conf/php5.5.3/php.ini not here /Applications/MAMP/bin/php/php5.5.3/conf/php.ini commenting out in the second location solved my problem put it as in answer and I will mark as accepted!Virelay
update: commenting out opcache here /Applications/MAMP/bin/php/php5.5.3/conf/php.ini and restarting apache solved my problem - still works without caching when I commented out the PHP headers and the meta no cache tags.Virelay
ive done all of this and still 8mb limitFinalist
@Finalist not sure what you mean, nothing here is about memory limit. Also keep in mind this is from 2014, so this may be way outdated.Virelay
E
14

@Philippe, Ensure you commented out OPcache in

/Applications/MAMP/bin/php/php5.5.3/conf/php.ini

not the one in

/Applications/MAMP/conf/php5.5.3/php.ini

Edi answered 3/2, 2014 at 23:18 Comment(0)
C
9

Fast-forwarding to 2022, MAMP now has this as a UI option.

For anyone on MAMP Pro for OSX (Monterey), the PHP setting can be accessed through the "View Mode" toggle (to "Expert" mode). By default, it's set to "Standard" mode and hides many of these options.

Click on the PHP tab in the left column, then go to dropdown with "Cache module to speed up execution". Select "off".

Corody answered 10/3, 2022 at 18:1 Comment(2)
Please note: This question was about MAMP, not MAMP Pro. MAMP Pro also had this setting when this question was first asked 8 years ago.Virelay
I got here looking exactly for that, thank you!Hunley
A
2

In MAMP Version 6.8 you can find it in the main MAMP window. "Preferences" option, "General" tab:

enter image description here

Autotransformer answered 3/12, 2023 at 10:20 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.