From 05d084542f7e71af9736afce6d93bb2fc1055dfc Mon Sep 17 00:00:00 2001 From: merdan Date: Tue, 22 Jun 2021 16:18:42 +0500 Subject: [PATCH] cache log --- .../cacheroute/classes/RouteCacheMiddleware.php | 7 ++++++- themes/modern2/partials/post_list_item.htm | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/serenitynow/cacheroute/classes/RouteCacheMiddleware.php b/plugins/serenitynow/cacheroute/classes/RouteCacheMiddleware.php index ce7837fb6..8acf97541 100644 --- a/plugins/serenitynow/cacheroute/classes/RouteCacheMiddleware.php +++ b/plugins/serenitynow/cacheroute/classes/RouteCacheMiddleware.php @@ -2,6 +2,7 @@ namespace SerenityNow\Cacheroute\Classes; use Illuminate\Http\Request as LaravelRequest; +use Illuminate\Support\Facades\Log; use SerenityNow\Cacheroute\Models\CacheRoute; use Closure; @@ -32,7 +33,11 @@ class RouteCacheMiddleware { $cacheKey = $this->getCacheKey($request->url()); if (\Cache::has($cacheKey)) { - return \Response::make($this->getCachedContent($cacheKey, $request, \Cache::get($cacheKey)), 200); + $content = \Cache::get($cacheKey); + if($content) + return \Response::make($this->getCachedContent($cacheKey, $request, $content), 200); + else + Log::error('blank cache',$content,$cacheKey); } $response = $next($request); diff --git a/themes/modern2/partials/post_list_item.htm b/themes/modern2/partials/post_list_item.htm index 2bd5fee16..2afb4d30e 100644 --- a/themes/modern2/partials/post_list_item.htm +++ b/themes/modern2/partials/post_list_item.htm @@ -1,5 +1,5 @@
- +