Created
April 11, 2018 10:46
-
-
Save sursir/12ebb77cc6cb093b328af81bfc4a8999 to your computer and use it in GitHub Desktop.
artisan laravel 缓存 cache
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #** artisan 缓存 ** | |
| # public/storage 链接 | |
| php artisan storage:link # storage/app/public -> public/storage | |
| # storage 软链接到固定目录 | |
| ln -sf ../../storage storage | |
| # 清除缓存 | |
| php artisan cache:clear | |
| ## 清除 试图缓存 | |
| php artisan view:clear | |
| ## 清除 路由缓存 | |
| php artisan route:clear | |
| 统计总结 | |
| ================================ | |
| #@@@ 自动加载优化 | |
| #注意:php artisan optimize --force 命令里已经做了这个操作。 接下 ↓ | |
| composer dumpautoload | |
| #@@@ optimize 命令把常用加载的类合并到一个文件里,通过减少文件的加载,来提高运行效率: | |
| #会生成 bootstrap/cache/compiled.php 和 bootstrap/cache/services.json 两个文件。 | |
| #可以通过修改 config/compile.php 文件来添加要合并的类。 | |
| #注意:此命令要运行在 php artisan config:cache 后, | |
| #因为 optimize 命令是根据配置信息(如:config/app.php 文件的 providers 数组)来生成文件的。 | |
| # 缓存 | |
| artisan optimize --force | |
| # 清除 | |
| #php artisan clear-compiled | |
| #@@@ 可以手动cache的 | |
| artisan route:cache # 注意如果使用了闭包路由则无法对路由进行缓存 会报逻辑异常错误 | |
| artisan config:cache | |
| #@@@ 可以手动清除的 | |
| artisan route:clear | |
| artisan config:clear | |
| artisan view:clear | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment