OPcache: Bytecode Caching
Enable and tune OPcache to eliminate repeated script compilation overhead.
How PHP Normally Works
Without OPcache, every request causes PHP to: read the .php file from disk, parse it into an AST, compile it to opcodes (bytecode), then execute the opcodes.
What OPcache Does
OPcache stores compiled opcodes in shared memory. On subsequent requests, PHP skips the parse and compile steps — jumping straight to execution.
All lessons in this course
- Profiling PHP with Xdebug
- OPcache: Bytecode Caching
- Optimizing Database Queries
- Memory Management and Performance Tips