Home > Enterprise >  Why and where does my PHP code suddenly get cached?
Why and where does my PHP code suddenly get cached?

Time:01-25

Since about a week I've got a very strange caching problem. I did not make any changes I know of which could possibly lead to this problem.

It happens using:

  1. PHP 8.1.9
  2. Apache 2.4.48 or the built-in symfony web server
  3. PHPStorm or notepad
  4. symfony or just plain PHP
  5. Firefox or Edge

My output gets cached somehow. I can completely destroy the PHP code or rename/delete files -> still displayed correctly. Some time later it finally refreshes and displays the errors. The errors themselves don't get cached. Fixing them immediately returns the script to the expected behaviour. I've already disabled caching inside Firefox (in the settings and setting disk.cache.enabled to false), but it happens with Edge, too.

The only common thing my experiments share is the PHP version/installation, it probably does not have to do anything with Apache, symfony or the browser.

Any ideas?

CodePudding user response:

I've found the answer.

Somehow opcache.revalidate_freq inside the php.ini was set to 200 and zend_extension=opcache enabled. I've never changed this manually. Would be interesting to find out what caused the change.

  • Related