You are here

public function DenyBigPipeSessionlessResponses::check in Sessionless BigPipe 8

Same name and namespace in other branches
  1. 2.x src/PageCache/ResponsePolicy/DenyBigPipeSessionlessResponses.php \Drupal\big_pipe_sessionless\PageCache\ResponsePolicy\DenyBigPipeSessionlessResponses::check()

Determines whether it is save to store a page in the cache.

Parameters

\Symfony\Component\HttpFoundation\Response $response: The response which is about to be sent to the client.

\Symfony\Component\HttpFoundation\Request $request: The request object.

Return value

string|null Either static::DENY or NULL. Calling code may attempt to store a page in the cache unless static::DENY is returned. Returns NULL if the policy policy is not specified for the given response.

Overrides ResponsePolicyInterface::check

File

src/PageCache/ResponsePolicy/DenyBigPipeSessionlessResponses.php, line 18

Class

DenyBigPipeSessionlessResponses
A policy denying caching of a BigPipe sessionless responses.

Namespace

Drupal\big_pipe_sessionless\PageCache\ResponsePolicy

Code

public function check(Response $response, Request $request) {
  if ($response instanceof BigPipeResponse) {
    return static::DENY;
  }
}