If you've optimised your WordPress site — added a caching plugin, compressed images, set up a CDN — and it still feels slow on uncached pages, OPcache is likely where you'll find the remaining gain.
What PHP Does Without OPcache
PHP is an interpreted language. Without OPcache, every request goes through this sequence:
- Read the PHP source file from disk
- Parse the source code into a syntax tree
- Compile the syntax tree to bytecode
- Execute the bytecode
- Discard the parsed and compiled result
For a WordPress page request, PHP loads and processes hundreds of files — WordPress core, your active plugins, your theme. That parse-and-compile cycle repeats from scratch on every single request.
What OPcache Changes
OPcache intercepts step 3. After the first request compiles a file, it stores the bytecode in shared memory. Every subsequent request that needs the same file skips steps 1–3 entirely and jumps straight to execution.
For WordPress:
- First request after the cache is empty: same as without OPcache
- All subsequent requests: hundreds of files are served from memory instead of being re-read and re-parsed
The result is 30–50% faster PHP execution for typical WordPress workloads. On a page that takes 400ms uncached, that's 120–200ms recovered without any code changes.
OPcache on TrueCore
OPcache is enabled on all accounts. It's built into PHP 8.x and configured at the server level — there's nothing to install or activate.
The key configuration settings:
opcache.enable = 1— enabledopcache.memory_consumption— sized to hold WordPress core plus a typical plugin set comfortably in memoryopcache.validate_timestamps = 1— PHP checks whether files have changed before using cached bytecode, so plugin and theme updates take effect without manual cache clearing
When the Cache Gets Cleared
OPcache is cleared automatically when:
- The PHP process restarts (after a deployment or maintenance event)
- A file's modification timestamp changes and
validate_timestampsis on (the default)
You don't need to manually clear OPcache after installing or updating plugins via the WordPress admin — WordPress writes the updated files to disk, OPcache detects the change, and the next request recompiles that file.
If you edit PHP files directly over SFTP or SSH and your changes aren't appearing, OPcache may be serving the old bytecode. Restart PHP-FPM from the terminal (site restart php) to clear it.
Verifying OPcache Is Active
In your WordPress admin, go to Tools → Site Health → Info → Server. OPcache status is listed under the PHP configuration section.
Alternatively, create a temporary file in your web root:
<?php phpinfo(); ?>
Visit it and look for the OPcache section — it shows enabled status, memory usage, and hit/miss statistics. Delete the file afterwards.
OPcache vs Page Caching
These are separate and complementary:
- OPcache caches compiled PHP bytecode — it speeds up PHP execution for every request, including dynamically generated pages
- Page caching (WP Super Cache, W3 Total Cache, etc.) serves pre-built HTML files and bypasses PHP entirely for cached pages
Page caching has a bigger effect on time to first byte for cached pages. OPcache has the bigger effect on uncached pages, logged-in users, and anything that can't be page-cached (checkout pages, admin, REST API requests).
Use both.