cache fix

This commit is contained in:
merdan 2021-06-22 16:42:50 +05:00
parent 05d084542f
commit e983f1bfc8
1 changed files with 3 additions and 1 deletions

View File

@ -33,11 +33,13 @@ class RouteCacheMiddleware
{ {
$cacheKey = $this->getCacheKey($request->url()); $cacheKey = $this->getCacheKey($request->url());
if (\Cache::has($cacheKey)) { if (\Cache::has($cacheKey)) {
$content = \Cache::get($cacheKey); $content = \Cache::get($cacheKey);
if($content) if($content)
return \Response::make($this->getCachedContent($cacheKey, $request, $content), 200); return \Response::make($this->getCachedContent($cacheKey, $request, $content), 200);
else else
Log::error('blank cache',$content,$cacheKey); \Cache::forget($cacheKey);
} }
$response = $next($request); $response = $next($request);