/** * Gets the 'drupal.proxy_original_service.page_cache_response_policy' service. * * This service is shared. * This method always returns the same instance of the service. * * @return \Drupal\Core\PageCache\ChainResponsePolicy A Drupal\Core\PageCache\ChainResponsePolicy instance. */ protected function getDrupal_ProxyOriginalService_PageCacheResponsePolicyService() { $a = $this->get('current_route_match'); $this->services['drupal.proxy_original_service.page_cache_response_policy'] = $instance = new \Drupal\Core\PageCache\ChainResponsePolicy(); $instance->addPolicy(new \Drupal\node\PageCache\DenyNodePreview($a)); $instance->addPolicy(new \Drupal\image\PageCache\DenyPrivateImageStyleDownload($a)); $instance->addPolicy(new \Drupal\Core\PageCache\ResponsePolicy\NoServerError()); $instance->addPolicy(new \Drupal\Core\PageCache\ResponsePolicy\DenyNoCacheRoutes($a)); $instance->addPolicy($this->get('page_cache_kill_switch')); $instance->_serviceId = 'drupal.proxy_original_service.page_cache_response_policy'; return $instance; }
/** * Gets the 'page_cache_response_policy' service. * * This service is shared. * This method always returns the same instance of the service. * * @param bool $lazyLoad whether to try lazy-loading the service with a proxy * * @return \Drupal\Core\PageCache\ChainResponsePolicy A Drupal\Core\PageCache\ChainResponsePolicy instance. */ public function getPageCacheResponsePolicyService($lazyLoad = true) { if ($lazyLoad) { return $this->services['page_cache_response_policy'] = new Drupal_Core_PageCache_ChainResponsePolicy_Proxy($this, 'page_cache_response_policy'); } $a = $this->get('current_route_match'); $instance = new \Drupal\Core\PageCache\ChainResponsePolicy(); $instance->addPolicy(new \Drupal\node\PageCache\DenyNodePreview($a)); $instance->addPolicy(new \Drupal\image\PageCache\DenyPrivateImageStyleDownload($a)); $instance->addPolicy(new \Drupal\Core\PageCache\ResponsePolicy\NoServerError()); $instance->addPolicy(new \Drupal\Core\PageCache\ResponsePolicy\DenyNoCacheRoutes($a)); $instance->addPolicy($this->get('page_cache_kill_switch')); $instance->_serviceId = 'page_cache_response_policy'; return $instance; }