What is OPcache, and how does it improve the execution speed of PHP scripts?
Last updated
OPcache is a bundled extension that caches precompiled bytecode (opcodes) in shared memory.
Without it, every request re-reads, tokenizes, parses and compiles each file. With it, requests skip straight to execution, saving CPU and disk I/O.
Tune it with
opcache.memory_consumption,opcache.max_accelerated_filesandopcache.validate_timestampsfor faster responses with no code changes.