You are here

public function ResponseCacheStrategy::add in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-kernel/HttpCache/ResponseCacheStrategy.php \Symfony\Component\HttpKernel\HttpCache\ResponseCacheStrategy::add()

Adds a Response.

Parameters

Response $response:

Overrides ResponseCacheStrategyInterface::add

File

vendor/symfony/http-kernel/HttpCache/ResponseCacheStrategy.php, line 39

Class

ResponseCacheStrategy
ResponseCacheStrategy knows how to compute the Response cache HTTP header based on the different 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();
  }
  ++$this->embeddedResponses;
}