简体   繁体   中英

Laravel, PHP, and OPCache - Not caching all files

My Laravel application has roughly 10,000 files, including the 3rd party packages in my vendor directory. However, with OPCache enabled, it seems to only be caching 667 files and 1,321 keys.

Is there anything I'm missing, or is that potentially accurate? Below are some of the stats from my OPCache Status:

total memory: 300.00MB used memory: 26.83MB free memory: 273.17MB wasted memory: 0.00b (0%) number of cached files: 667 number of hits: 3,621,095 number of misses: 849 blacklist misses: 0 number of cached keys: 1,321 max cached keys: 16,229

If you are using artisan optimize , it compiles PHP classes into single compiled.php .

Also, not all files are php, and not all php files are being used.

I'd expect static files to be served directly by httpd without using php, and tests should not to be touched on prod at all.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM