Laravel技巧集锦(14):使用自带的路由缓存、配置缓存、类加载优化

版权声明:http://www.itchuan.net https://blog.csdn.net/sinat_37390744/article/details/88539819

1、路由缓存(路由中不能含有匿名函数、include包含文件)【缓存文件位置bootstrap\cache\routes.php】

php artisan route::cache

2、配置缓存【缓存文件位置bootstrap\cache\config.php】

php artisan config::cache

3、优化类加载(原本基于psr-4加载,类似递归,比较耗时,因此优化)【文件位置vendor\composer\autoload_classmap.php】

php artisan optimize

猜你喜欢

转载自blog.csdn.net/sinat_37390744/article/details/88539819