
WordPress
How WordPress Version Control Actually Works
Learn how WordPress version control works across Git, databases, deployments, backups, rollbacks and multi-site workflows.
Learn how to flush and monitor PHP OPcache in WordPress safely, what OPcache plugins really do and how managed hosting like Pantheon handle it automatically.

PHP OPcache is a core PHP extension that improves WordPress performance by storing precompiled PHP bytecode in shared memory, eliminating repeated parsing and compilation on every request. On high-traffic or plugin-heavy sites, this reduces CPU usage and stabilizes response times.
However, OPcache operates at the server layer, not inside WordPress. Many teams expect a plugin to control OPcache the same way it controls page or object caching, but OPcache doesn’t work like that. What plugins can influence, what the server ultimately controls and where hosting platforms like Pantheon draw that boundary are the key distinctions you need to understand – so let’s break it down.
WordPress OPcache plugins don’t make WordPress faster by adding a new cache. Instead, they help you see, control and safely work with a performance feature that already exists at the PHP level.
At a high level, PHP OPcache speeds up WordPress by keeping compiled PHP code in memory so it doesn’t have to be reprocessed on every request. This happens outside WordPress itself, which is why OPcache can feel confusing. It’s always running in the background, but WordPress doesn’t natively expose what it’s doing. That’s why people turn to WordPress OPcache plugins.
Most WordPress OPcache plugins only help with:
What WordPress OPcache plugins don’t do is enable OPcache, change low-level PHP settings or replace page and object caching. They also don’t make poorly written code fast – they simply ensure PHP executes efficiently.
Usually, no, your hosting setup won’t need a WordPress OPcache plugin. In most modern WordPress hosting environments, OPcache is already enabled and working at the server level without any plugin required.
OPcache is a server-level PHP feature, not something WordPress controls directly. On managed platforms like Pantheon, OPcache is part of the underlying runtime and is not customer-configurable. In live environments, code isn’t written directly and OPcache is automatically cleared as part of the deploy process. That means there’s no expectation or need for site owners to manually flush OPcache during normal updates.
As we said before, in most modern WordPress hosting, especially managed platforms, OPcache is already enabled by default. Still, verifying it can help you understand how your environment is working.
One option to check whether OPcache is enabled on your server is by using phpinfo():
<?php phpinfo(); ?>
If you’d rather not create files, WordPress’s built-in Site Health tool can sometimes surface OPcache status under Tools > Site Health > Info > Server, depending on your host.
And, if you want to use a plugin for this and for ongoing visibility, OPcache Manager or WP OPcache are good options. Though keep in mind that plugins don’t enable OPcache.
Let’s reiterate that WordPress OPcache plugins don’t change how OPcache behaves internally. They only provide different ways to observe it, coordinate it with updates or interact with it during development.
Which plugin – if any at all – makes sense depends on how your site is hosted and how code changes are introduced:
⚠️ As a general rule, we do not recommend managing OPcache yourself from inside WordPress and that includes relying on plugins to flush or control it.
On platforms like Pantheon, OPcache is already managed as part of the deployment process and is cleared automatically when code is deployed. It is tightly integrated into the platform’s deployment workflow and is automatically cleared when code is deployed. Customers cannot (and do not need to) change OPcache settings at the server level and manual cache flushing is intentionally not part of the normal workflow.
Because of that, installing WordPress OPcache plugins on Pantheon can be misleading at best and harmful at worst if they encourage behaviors that don’t align with how the platform works.
OPcache makes WordPress fast by reusing compiled PHP code, but that same behavior means it must be handled carefully when code changes. If WordPress core, a plugin or a theme is updated, OPcache may continue serving an older compiled version of the code unless it’s told that something changed. When that happens, WordPress can briefly run a mix of old and new code, which is where fatal errors and strange post-update bugs come from.
How you deal with this depends entirely on your hosting setup.
On managed WordPress platforms like Pantheon, customers are not expected to manually flush OPcache at all. Code is deployed through a controlled pipeline, PHP files aren’t writable on Live and OPcache is automatically cleared as part of the deploy process. Installing plugins or workflows that attempt to bypass that deploy → cache-clear sequence can actually cause issues rather than prevent them.
On self-managed servers or shared hosting, things are different. If OPcache is configured for performance and doesn’t automatically check for file changes, then clearing OPcache after updates becomes essential. The safest approach for most WordPress sites in these environments is automation. Plugins such as OPcache Reset clear OPcache immediately after WordPress core, plugin or theme updates, ensuring new code is executed consistently without requiring server access.
Be especially cautious with code that calls opcache_reset(). This function clears the entire OPcache memory pool immediately, forcing PHP to recompile all files and potentially causing CPU spikes under load. It should never run during normal site activity or common admin actions and is best reserved for controlled deployment workflows at the server level.
If you do have server access, reloading PHP-FPM as part of your deployment process is the most reliable method. A graceful reload clears OPcache while allowing active requests to finish, making it suitable for production use. This approach is commonly wired into CI/CD pipelines.
What’s just as important is knowing when not to clear OPcache. Publishing content, editing pages, changing settings or updating database-driven content does not require OPcache clearing, because OPcache only affects PHP code, not HTML output or stored data. Clearing it unnecessarily can hurt performance, especially on high-traffic sites, by forcing PHP to recompile everything at once.
So, the safest approach is to let your hosting platform handle OPcache automatically when possible and only introduce explicit clearing when your workflow truly requires it.
OPcache problems rarely present as clear errors. They may show up indirectly through slower response times, elevated CPU usage or brief performance drops after deployments or updates. For those of you not using managed WordPress hosting, monitoring can help you identify these issues early and confirm that OPcache is correctly sized and behaving as expected.
Here’s what to look out for:
On most managed platforms, including Pantheon, OPcache is already monitored and coordinated with deployments at the platform level, so users never have to keep an eye out for these metrics directly.
By now, you already know that OPcache lives at the PHP and hosting layer, not inside WordPress. And unless you absolutely need to handle OPcache yourself, it’s best to leave it to your managed WordPress hosting.
On Pantheon, you don’t have to do a single thing when it comes to the OPcache in WordPress. The platform safely and automatically clears OPcache at the right moment, without exposing OPcache settings, buttons or reset logic to WordPress.
This removes the need for WordPress OPcache plugins entirely on Pantheon. There’s no guessing when to flush, no risk of stale bytecode after updates and no plugins trying to override PHP behavior mid-request. OPcache is treated as part of the runtime, not a WordPress feature to manage.
Beyond OPcache, Pantheon provides:
The end result is a WordPress hosting environment that delivers optimal performance.
Want hosting that handles the heavy lifting for you? Try Pantheon today and unlock a faster, more reliable WordPress workflow.

WordPress
Learn how WordPress version control works across Git, databases, deployments, backups, rollbacks and multi-site workflows.

Website Security
Learn how IT teams can manage WordPress vulnerability exposure after patching, from inventory and verification to investigation, recovery, and readiness.