OPcache (previously "Zend Optimizer+") is PHP's official bytecode cache. PHP converts each script via parser into bytecode (a near-machine-code format) and then executes it. This compilation repeats on every request and takes substantial time. OPcache stores the compilation result in RAM and serves it directly on subsequent requests โ this significantly speeds up sites.
What OPcache delivers
Standard PHP site (no OPcache): file reads, parser, syntax check, bytecode generation, executor โ all ~50-200 ms total. With OPcache this drops to 5-20 ms (10x faster). A basic WordPress site may go from 800 ms page load to 200 ms. On large sites the effect is even bigger.
OPcache configuration
OPcache is built into PHP 5.5+, but defaults are conservative โ you need to tune them. Set the following in .user.ini or php.ini:
opcache.enable = 1
opcache.memory_consumption = 256
opcache.interned_strings_buffer = 16
opcache.max_accelerated_files = 10000
opcache.validate_timestamps = 1
opcache.revalidate_freq = 60
opcache.fast_shutdown = 1
memory_consumption โ how much RAM OPcache gets (in MB). Recommended: WordPress 128-256, large e-commerce 256-512. max_accelerated_files โ how many files fit in the cache. For Composer-based projects use 20000-30000.
validate_timestamps and revalidate_freq โ when to check files for changes. Production: revalidate_freq = 60 (check every minute); development: validate_timestamps = 0 (don't check) or revalidate_freq = 0 (check every request).
Checking OPcache status
You can use the opcache_get_status() PHP function. In practice GUI tools are easier โ the best-known is OPcache GUI (rlerdorf/opcache-status by Rasmus Lerdorf, PHP's creator).
Cache busting issue
If you change code and the site shows the old version, clear OPcache: call opcache_reset() in PHP or restart PHP-FPM. cPanel typically has a "Reset OPcache" button.
Sayt.uz practice
Sayt.uz default tariffs ship with OPcache enabled and tuned: 256M RAM, 30000 max files. Clients can override via .user.ini. WordPress sites run 3-5x faster with OPcache โ Largest Contentful Paint (LCP) drops from 800ms to 200ms. Tip: enable OPcache and monitor it โ it sells nothing on its own, but sharply improves user experience.