public function EsiResponseCacheStrategy::add

Adds a Response.

Parameters

Response $response:

Overrides EsiResponseCacheStrategyInterface::add

File

drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/HttpCache/EsiResponseCacheStrategy.php, line 40

Class

EsiResponseCacheStrategy
EsiResponseCacheStrategy knows how to compute the Response cache HTTP header based on the different ESI response cache headers.

Namespace

Symfony\Component\HttpKernel\HttpCache

Code

public function add(Response $response) {
  if ($response
    ->isValidateable()) {
    $this->cacheable = false;
  }
  else {
    $this->ttls[] = $response
      ->getTtl();
    $this->maxAges[] = $response
      ->getMaxAge();
  }
}