There is configuration for that actually.
opcache.revalidate_freq=2
, the default value is 2 seconds, opcache will try to check for timestamps every 2 seconds and if the files are changed it will revalidate.
You can change the value to match your needs, or you can just turn timestamp check off using this conf opcache.validate_timestamps=0
, but in this case each time you deploy code to production you have to restart php-fpm (if you are using php-fpm) and web server
opcache.revalidate_freq=2
or any integer value
opcache.validate_timestamps=1
or opcache.validate_timestamps=0