function DynamicPageCacheSubscriber::__construct

Same name and namespace in other branches
  1. 10 core/modules/dynamic_page_cache/src/EventSubscriber/DynamicPageCacheSubscriber.php \Drupal\dynamic_page_cache\EventSubscriber\DynamicPageCacheSubscriber::__construct()
  2. 11.x core/modules/dynamic_page_cache/src/EventSubscriber/DynamicPageCacheSubscriber.php \Drupal\dynamic_page_cache\EventSubscriber\DynamicPageCacheSubscriber::__construct()
  3. 9 core/modules/dynamic_page_cache/src/EventSubscriber/DynamicPageCacheSubscriber.php \Drupal\dynamic_page_cache\EventSubscriber\DynamicPageCacheSubscriber::__construct()
  4. 8.9.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 $requestPolicy: A policy rule determining the cacheability of a request.

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

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

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

array $rendererConfig: The renderer configuration array.

File

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

Class

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

Namespace

Drupal\dynamic_page_cache\EventSubscriber

Code

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

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