function DynamicPageCacheSubscriber::__construct

Same name in other branches
  1. 9 core/modules/dynamic_page_cache/src/EventSubscriber/DynamicPageCacheSubscriber.php \Drupal\dynamic_page_cache\EventSubscriber\DynamicPageCacheSubscriber::__construct()
  2. 8.9.x core/modules/dynamic_page_cache/src/EventSubscriber/DynamicPageCacheSubscriber.php \Drupal\dynamic_page_cache\EventSubscriber\DynamicPageCacheSubscriber::__construct()
  3. 11.x core/modules/dynamic_page_cache/src/EventSubscriber/DynamicPageCacheSubscriber.php \Drupal\dynamic_page_cache\EventSubscriber\DynamicPageCacheSubscriber::__construct()

Constructs a new DynamicPageCacheSubscriber object.

Parameters

\Drupal\Core\PageCache\RequestPolicyInterface $request_policy: A policy rule determining the cacheability of a request.

\Drupal\Core\PageCache\ResponsePolicyInterface $response_policy: A policy rule determining the cacheability of the response.

\Drupal\Core\Cache\VariationCacheInterface $cache: The variation cache.

\Drupal\Core\Cache\Context\CacheContextsManager $cache_contexts_manager: The cache contexts manager service.

array $renderer_config: The renderer configuration array.

File

core/modules/dynamic_page_cache/src/EventSubscriber/DynamicPageCacheSubscriber.php, line 115

Class

DynamicPageCacheSubscriber
Returns cached responses as early and avoiding as much work as possible.

Namespace

Drupal\dynamic_page_cache\EventSubscriber

Code

public function __construct(RequestPolicyInterface $request_policy, ResponsePolicyInterface $response_policy, VariationCacheInterface $cache, CacheContextsManager $cache_contexts_manager, array $renderer_config) {
    $this->requestPolicy = $request_policy;
    $this->responsePolicy = $response_policy;
    $this->cache = $cache;
    $this->cacheContextsManager = $cache_contexts_manager;
    $this->rendererConfig = $renderer_config;
    $this->requestPolicyResults = new \SplObjectStorage();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.