Reputation:
I guess I've got some doubts on how "Zend Opcache" actually works, I'm wondering how am I supposed to save in cache only the files I include trough the PHP include()
method? It seems that even not specifying opcache_compile_file()
all files are cached, "index.php" included, that I don't want to be. In fact all variables that I assign in index are not refreshed for each session but I only see the cached version of index.
Can anyone explain?
Thanks in advance
Upvotes: 1
Views: 2866
Reputation: 11
I used to have the same problem and I came up with this solution: in the opcache configurations I set opcache.blacklist_filename to the path of an external blacklist file where I wrote the names of the classes I didn't want to be cached. See the documentation here for further details http://www.php.net/manual/en/opcache.configuration.php#ini.opcache.blacklist-filename
Upvotes: 1
Reputation: 1086
Zend OpCache is only a cache for PHP's opcodes and saves the processor from having to convert source code to opcodes until it (the source code) changes. If you need userland caching for data that your script uses, use APCu. When you say your vairables are not refreshed, do you have a reverse proxy in front of your web server?
Upvotes: 0