Question

What criteria is used to determine whether a cache hit has occurred in PHP OPcache? I would think that things like the request URL, headers, etc. would affect whether a hit occurs or not, but how does OPcache deal with things like pages/scripts that rely on cookies/sessions for rendering the page?

Was it helpful?

Solution

You're confusing PHP Opcache with an HTTP cache.

PHP Opcache doesn't cache the output of a PHP page. Instead, it caches the internal representation used by PHP for a PHP source file, allowing it to be executed immediately when needed, rather than requiring PHP to reparse source files every time a page is requested.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top