protected function getResponse(View $view) { if ($view instanceof ICacheable) { if ($cached_response = $this->fromCache($view->hash())) { $view->headers['X-Cache'] = 'hit'; return $cached_response; } else { $view->headers['X-Cache'] = 'miss'; $fresh_response = parent::getResponse($view); $this->toCache($fresh_response, $view->hash(), $view->expire()); return $fresh_response; } } return parent::getresponse($view); }
protected function getResponse(View $view) { return $view->response(); }