You are here

public function DynamicPageCacheSubscriber::__construct in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/dynamic_page_cache/src/EventSubscriber/DynamicPageCacheSubscriber.php \Drupal\dynamic_page_cache\EventSubscriber\DynamicPageCacheSubscriber::__construct()
  2. 10 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\Render\RenderCacheInterface $render_cache: The render cache.

array $renderer_config: The renderer configuration array.

File

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

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, RenderCacheInterface $render_cache, array $renderer_config) {
  $this->requestPolicy = $request_policy;
  $this->responsePolicy = $response_policy;
  $this->renderCache = $render_cache;
  $this->rendererConfig = $renderer_config;
  $this->requestPolicyResults = new \SplObjectStorage();
}