Using MAMP, when I change a PHP file and save it, it takes 10-15 seconds for it to be available in my browser. HTML files update immediately. Example:
Example file:
<!DOCTYPE html>
<html>
<body>
<p>This is test</p>
</body>
</html>
When this file is named index.html and placed in MAMP/htdocs directory I can update it, save, open it at http://localhost/index.html
and the update is there. If I simply rename the file to index.php (no php code), update and save, I can sit there and refresh browser for 10-20 seconds before I see the update (the old file reloads until the new version appears). I'm a rookie and new to server side scripting, so I'm not sure what is going on with an update to a PHP file - is there some processing that happens by Apache(?) before the file is able to be served? Is my PHP configuration a possible cause?
MacBook Pro osx10.8.5 2.8 Core2Duo 8GB (yes, it's old) -- MAMP 2.2 using port 80 -- PHP 5.5.3 -- Same behavior in all browsers -- Same behavior without an internet connection, so I don't think it is some DNS lookup issue
Since you're accessing the file via localhost, DNS shouldn't be an issue. If HTML files serve instantaneously, it might be that there is a PHP caching setting. Does this help - http://top-frog.com/2011/03/14/beware-mamps-default-caching-settings/ ?