Laravel清空缓存的命令
一般流程是:
- 先清空缓存(你已经列出清空命令)。
- 然后重新生成缓存,常用的是 config:cache 和 route:cache,视图缓存用 view:cache。
示例:
php artisan cache:clear
php artisan config:clear
php artisan route:clear
php artisan view:clear
php artisan optimize:clear
# 然后重新生成缓存
php artisan config:cache
php artisan route:cache
php artisan view:cache
php artisan optimize
注意:php artisan optimize 其实会自动调用 config:cache 和 route:cache,在 Laravel 8 以后该命令作用有限,有时候用 config:cache 和 route:cache 更明确。
评论
评论 (0)