配置信息缓存
把config下的配置文件合并,减少文件载入次数
php artisan config:cache
此命令会生成:bootstrap/cache/config.php文件,通过以下命令可以删除该文件:
php artisan config:clear
PS:修改config文件不会自动生成缓存文件
路由缓存
提高路由效率
php artisan route:cache
此命令会生成:bootstrap/cache/routes.php文件,通过以下命令可以删除该文件:
php artisan route:clear
PS: 修改路由文件不会自动重载缓存文件
类加映射加载优化
把常用加载的类合并到一个文件里,提高加载效率
php artisan optimize --force
此命令会生成:bootstrap/cache/compiled.php 和 bootstrap/cache/services.json 两个文件 <