5 ms·
Thanks for checking it out! The obvious answer is, you may want to clear it when you have code changes that you'd like to see without restarting the server. You
by jessehorne 7y ago
Thanks for checking it out! The obvious answer is, you may want to clear it when you have code changes that you'd like to see without restarting the server. You can configure the opcache to never check if files have changed. This makes it even quicker because it doesn't have to check modification times on files. Unfortunately, if you do that, changes to your code aren't ever going to be reflected. This can cause issues in wordpress whenever you update plugins and such. The plugin we wrote automatically will notify php that it needs to clear the opcache so that those changes can be reflected. This way you can have the opcache configured for the highest performance without suffering the drawbacks of not being able to easily update plugins automatically.
- jessehorne 7y agoAlternatively, you can configure the opcache to check mtime on files, but there is a performance hit for doing that, since each request will be checking the mtime on potentially hundreds of files before accepting that the cache is up to date.