Opcode Cache

OPcache, Bytecode cache, PHP opcode cache, Opcode caching
Opcode cache stores compiled PHP code in memory, so your server doesn't have to reprocess it with every request. This speeds up WordPress sites significantly.

What is Opcode Cache?

Opcode cache is a mechanism that temporarily stores compiled PHP code in your server's working memory. When a visitor requests a WordPress page, the server normally translates the PHP files into machine code with each request. With opcode cache, that translation operation happens only once, after which the compiled version is reused. For an average WordPress site, this results in a speed gain of 30 to 70 percent, especially with many simultaneous visitors.

How opcode cache speeds up the translation process

PHP is an interpreted language. That means that with each request, the server reads the source code, parses it, compiles it to bytecode and then executes it. For a WordPress homepage with dozens of plugins and a theme, this process can hit hundreds of files. Opcode cache stores the bytecode in RAM and skips parsing and compiling on subsequent requests. Only when a PHP file changes, the cache for that file is refreshed. This saves computing power and noticeably lowers your site's response time.

From APC to OPcache: the evolution

Early opcode caches such as APC (Alternative PHP Cache) were community extensions that you had to install manually. Since PHP 5.5, OPcache is the official opcode cache and comes with PHP by default. Modern hosting providers activate OPcache automatically, but many SMBs with older or self-managed servers have not yet enabled the extension. Check via phpinfo() that opcache.enable is set to 1. If it's not, you're missing out on a free performance boost that improves Google Core Web Vitals immediately.

What opcode cache brings to WordPress sites

For an ecommerce store running WooCommerce or a content site with many visitors, opcode cache makes the difference between a slow and a smooth experience. Every second of speed gain increases conversion and lowers bounce rate. In a thoughtful WordPress hosting environment, opcode cache is among the basic features, along with object cache and a CDN. In practice, we see with clients that enabling OPcache halves the server load during peak hours. That means you can continue to grow longer on the same hosting package and scale up less quickly. For an SMB with a limited IT budget, that's a tangible cost savings.

Applications of Opcode Cache

Opcode cache is not just a technical optimization, but a practical lever for businesses that depend on a fast WordPress site. Applications range from ecommerce stores with thousands of products to content platforms with complex data structures. Here are four situations where opcode cache makes all the difference.

High traffic ecommerce stores

A WooCommerce ecommerce store with 500 products and 20 plugins loads dozens of PHP files with each request. During a Black Friday promotion or a social media campaign, the number of simultaneous visitors can increase fivefold. Without opcode cache, the server has to recompile all the code with each request, leading to slow load times and timeouts. With OPcache, the bytecode remains in memory and the server can process three to five times as many requests per second. For a professional ecommerce store, this is essential to avoid lost sales during peak hours.

Content platforms with many dynamic pages

A news site, knowledge base or community platform often generates pages dynamically based on user roles, taxonomies and custom post types. Each page request triggers queries and PHP logic. Opcode cache speeds up PHP execution, but note that it does not replace page cache or object cache. For optimal speed, combine opcode cache with a page cache plugin like WP Rocket or a server-side cache like Varnish. In practice, we see with content platforms that opcode cache reduces time to first byte (TTFB) by 40 to 60 percent, directly contributing to better Core Web Vitals scores.

Multisite environments and SaaS platforms.

WordPress Multisite runs dozens or hundreds of subsites on a single codebase. Each subsite shares the same PHP files, but executes unique queries and logic. Opcode cache stores the shared bytecode once, benefiting all subsites. For a SaaS platform or a franchise organization with local websites, this provides huge efficiency gains. The server does not have to recompile the core, plugins and themes for each subsite. This lowers hosting costs and makes scaling easier.

When opcode cache is the right choice and when it is not

Opcode cache makes sense for any WordPress site running PHP 5.5 or higher. It requires no extra memory or configuration and delivers immediate results. But: opcode cache does not solve slow database queries, unoptimized images or lack of page caching. If your site remains slow after enabling OPcache, the bottleneck lies elsewhere. First, check your Core Web Vitals and use a tool such as Query Monitor to identify bottlenecks. Opcode cache is a foundation, not a panacea.

Want to apply this to your business? Monkey Vision helps SME entrepreneurs with web design, SEO and smart digital solutions. Schedule a no-obligation meeting and find out what's possible for you.

Schedule an introduction

Frequently Asked Questions

No, opcode cache and page cache operate at different levels. Opcode cache stores compiled PHP code in server memory so that the server does not have to re-translate it with each request. Page cache stores complete HTML pages, so WordPress doesn't have to run at all for returning visitors. For optimal speed, you need both. Opcode cache speeds up PHP execution, page cache avoids PHP execution whenever possible. In practice, combine OPcache with a plugin like WP Rocket or a server-side cache like Varnish for best results.

Both are complementary and mutually reinforcing. Opcode cache speeds up the PHP code itself, object cache stores database query results so WordPress doesn't have to go to the database as often. For a simple website with little dynamic content, opcode cache is sufficient. For an ecommerce store, multisite or content platform with lots of queries and user interactions, you need both. A rule of thumb: if you use more than 10 plugins or have custom post types, enable both OPcache and Redis or Memcached. When in doubt: start with opcode cache, it always yields gains without extra configuration.

With most modern hosting providers, OPcache is active by default. Check this via your hosting dashboard or by creating a phpinfo() page. If you see opcache.enable set to 1, it is already running. If not, ask your hosting provider to activate OPcache or modify the php.ini yourself if you have VPS or dedicated hosting. For managed WordPress hosting with parties like Kinsta or WP Engine, opcode cache is always included. If you want to optimize the configuration yourself, increase opcache.memory_consumption to 128 or 256 MB for sites with many plugins. A professional maintenance plan always includes a check of opcode cache and other server optimizations.

The best first step depends on your current server environment and performance. Is your site already running on modern hosting with OPcache, but remains slow? Then the bottleneck probably lies with database queries, images or missing page cache. Schedule a free 30-minute performance scan at Monkey Vision. We'll walk through your site live, check opcode cache, object cache and Core Web Vitals, and give you three concrete areas of improvement you can pick up this week. You'll get an honest assessment of the growth potential and know immediately whether an upgrade to optimized hosting or a technical audit makes sense. No sales pitch, just practical advice.

About the author

Monkey Vision

Monkey Vision is a full-service digital agency at Nijmegen, specializing in web design, SEO, and AI automation for small and medium-sized businesses. The knowledge base has been compiled by our team of online strategists and is continuously updated based on current insights.

Publication date: 26-04-2026
Last update: 26-04-2026