Esempio n. 1
0
 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);
 }
Esempio n. 2
0
 protected function getResponse(View $view)
 {
     return $view->response();
 }