3 namespace Drupal\Core\PageCache;
5 use Symfony\Component\HttpFoundation\Request;
6 use Symfony\Component\HttpFoundation\Response;
9 * Defines the interface for response policy implementations.
11 * The response policy is evaluated in order to determine whether a page should
12 * be stored a in the cache. Calling code should do so unless static::DENY is
13 * returned from the check() method.
15 interface ResponsePolicyInterface {
18 * Deny storage of a page in the cache.
23 * Determines whether it is save to store a page in the cache.
25 * @param \Symfony\Component\HttpFoundation\Response $response
26 * The response which is about to be sent to the client.
27 * @param \Symfony\Component\HttpFoundation\Request $request
31 * Either static::DENY or NULL. Calling code may attempt to store a page in
32 * the cache unless static::DENY is returned. Returns NULL if the policy
33 * policy is not specified for the given response.
35 public function check(Response $response, Request $request);