Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Opcache revalidate freq config in php.ini

If I'm setting this config in php.ini file:

opcache.revalidate_freq = 0

Will it still be better than disable Opcache system?

Because in my opinion, it will check for file updates every request, so it like the Opcache is disabled.

like image 257
Upim form Avatar asked Apr 28 '26 12:04

Upim form


2 Answers

It will check the timestamp on every request, if the timestamp is unchanged it will serve the file from cache, so you are still benefiting from the opcache.

like image 125
mendel Avatar answered Apr 30 '26 01:04

mendel


This is how soon opcache will check whether the php file has changed, as far as I know. I use 30 seconds:

opcache.revalidate_freq=30

what you're referring to is likely the on / off for that function:

opcache.validate_timestamps=1
like image 43
vladdy Avatar answered Apr 30 '26 01:04

vladdy



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!