'MAMP time between seeing live changes

I'm using MAMP server and wondering why changes I make to the PHP files are not instantaneously displayed when I page refresh (in browser). Is there a way to set this up? There are no caching settings on MAMP. Either I have to wait 20 seconds or stop and restart the server.



Solution 1:[1]

The Luc's answer is correct. There is an easier way to disable cache in Mamp (as of version 6.5).

  • Launch Mamp
  • Click Preferences
  • in PHP-Cache select off

enter image description here

Solution 2:[2]

The accepted answer doesn't apply to more recent PHP version (e.g. PHP 7.4), where opcache is enabled by default.

To disable opcache, edit the php.ini file located at (change the php version to the one you're using):

/Applications/MAMP/bin/php/php7.4.21/conf/php.ini

Change the following line:

;opcache.enable = 1

Into:

opcache.enable = 0

That solved the problem.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 SC1000