I have tried to cache some queries with Cache::remember(); but it doesn't work.
My script response code is 500(Internal Server Error).
Here is my code:
$filters = \Cache::remember("cache_filter", 20, function(){
$data['value1'] = MyClass::where('<condition>')->get();
$data['value2'] = MyClass::where('<condition>')->get();
$data['value3'] = MyClass::where('<condition>')->get();
return $data;
});
return view('custom.show')->with($filters);
Storage
permissions => 777
Cache path
=> storage_path('framework/cache')
Does anyone have an idea?
php artisan cache:clear
php artisan config:cache
before then you have to delete config.php
file from bootstrap/cache/
, if not then just run first command (1.)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.