Laravel、PHP 和 OPCache - 不缓存所有文件
Laravel, PHP, and OPCache - Not caching all files
我的 Laravel 应用程序大约有 10,000 个文件,包括我的 vendor 目录中的第 3 方包。但是,启用 OPCache 后,它似乎只缓存了 667 个文件和 1,321 个密钥。
我是否遗漏了什么,或者可能准确吗?以下是我的 OPCache 状态的一些统计数据:
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
如果您使用 artisan optimize
,它会将 PHP 类 编译成单个 compiled.php
。
此外,并非所有文件都是 php,也并非所有 php 文件都被使用。
我希望不使用 php 直接由 httpd 提供静态文件,并且根本不应该在产品上触及测试。
我的 Laravel 应用程序大约有 10,000 个文件,包括我的 vendor 目录中的第 3 方包。但是,启用 OPCache 后,它似乎只缓存了 667 个文件和 1,321 个密钥。
我是否遗漏了什么,或者可能准确吗?以下是我的 OPCache 状态的一些统计数据:
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
如果您使用 artisan optimize
,它会将 PHP 类 编译成单个 compiled.php
。
此外,并非所有文件都是 php,也并非所有 php 文件都被使用。
我希望不使用 php 直接由 httpd 提供静态文件,并且根本不应该在产品上触及测试。