/** * @param \Illuminate\Http\Request $request * @param \Closure $next * * @return Request */ public function handle(Request $request, Closure $next) { if ($this->responseCache->hasCached($request)) { return $this->responseCache->getCachedResponseFor($request); } $response = $next($request); if ($this->responseCache->shouldCache($request, $response)) { $this->responseCache->cacheResponse($request, $response); } return $response; }
/** * Flush the cache. */ public function flush() { $this->cache->flush(); }