Domanda

In the important notice section of this article it says:

Setting opcache.validate_timestamps to 0 (disabling it) will increase the performance, especially when you have an application with a lot of files, but it also means you have to reset the OPcache manually when you alter the application files.

If not fully understood, opcache.validate_timestamps=0 can break your application or cause hard to find issues.

The configuration above is for benchmarking only. For your production environments please use following values (note the opcache.validate_timestamps=1 part):

I'm not able to understand what it's trying to say. It would be great if anybody could explain the above statement. Thank you.

È stato utile?

Soluzione

OPCache will check for updated files at certain interval. The interval can be specified using opcache.validate_timestamps.

I.e. If you set opcache.validate_timestamps = 1 and opcache.revalidate_freq = 5 OPCache will check for updated files every 5 seconds.

Now if you set its value to 0. OPCache will not check for updated files. This means that when you update a file, rather then loading the updated file OPCache will still load old cached file. And you'll have to manually reset the OPCache using opcache_reset(), opcache_invalidate() in order to reflect your changes.

Here's a link from the PHP Manual.

opcache.validate_timestamps

Hope this helps.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top