0

I'm currently testing a web application and kept noticing my changes weren't being updated after each save of the PHP file.

As far as I'm aware, I'm using no current PHP caching solution. I'm running PHP 5.5.3 with a fresh copy of CodeIgniter.

Here's what happened:

  • I noticed PHP didn't seem to be loading the latest code changes as I made them
  • After noticing the problem, I output <?php echo time();?> into all my view files
  • Now, the time updates on every page load - indicating PHP is processing each page's code
  • But still sometimes the page code updates don't take place until 3-5 page loads later
  • I've tried disabling and empty my browser cache multiple times

Am I right in thinking this is a PHP issue rather than a browser one, given the fact that the time() output is being updated?

Jack
  • 9,615
  • 18
  • 72
  • 112

2 Answers2

1

PHP doesn't cache anything.

If time() is being updated, you know that there isn't a traditional cache issue.

It's possible you are dealing with filesystem caching if you are using something like NFS. That would explain the 3-5 second delay.

Brad
  • 159,648
  • 54
  • 349
  • 530
  • No NFS connection - this is running on my hard drive on my Mac. Just using my standard, local development machine. – Jack Dec 12 '13 at 19:36
  • 1
    @JackW-H What extensions do you have installed? Any opcode caching? How are you running PHP? FastCGI? – Brad Dec 12 '13 at 19:42
  • I literally just installed MAMP today, on a new machine. The only extensions installed would be one of those listed here: http://mamp.info/en/mamp/index.html – Jack Dec 12 '13 at 20:04
0

Well that was frustrating. Turns out that MAMP now installed and enables, by default, Zend OpCache - see Stop caching for PHP 5.5.3 in MAMP

Community
  • 1
  • 1
Jack
  • 9,615
  • 18
  • 72
  • 112