有没有办法刷新Laravel 4中的所有缓存?我使用file进行缓存.我在文件上读到你可以使用Cache::forget('key')
,但是如果我需要删除所有缓存呢?
An artisan command can also be useful, I think there's an issue on the repo, but not sure if it's implemented yet.
Thanks!
有没有办法刷新Laravel 4中的所有缓存?我使用file进行缓存.我在文件上读到你可以使用Cache::forget('key')
,但是如果我需要删除所有缓存呢?
An artisan command can also be useful, I think there's an issue on the repo, but not sure if it's implemented yet.
Thanks!
If you run php artisan list
then you can find all the commands available for artisan
, anyways, there is a command to clear the cache
and it's
php artisan cache:clear
此外,您还可以使用
foreach (Cache::getMemory() as $cacheKey => $cacheValue)
{
Cache::forget($cacheKey);
}
Update:
Cache::flush();