public function Response::getAge

Same name in this branch

Returns the age of the response.

Return value

integer The age of the response in seconds

3 calls to Response::getAge()
Response::getTtl in drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Response.php
Returns the response's time-to-live in seconds.
Response::setClientTtl in drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Response.php
Sets the response's time-to-live for private/client caches.
Response::setTtl in drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Response.php
Sets the response's time-to-live for shared caches.

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/Response.php, line 602

Class

Response
Response represents an HTTP response.

Namespace

Symfony\Component\HttpFoundation

Code

public function getAge() {
  if ($age = $this->headers
    ->get('Age')) {
    return $age;
  }
  return max(time() - $this
    ->getDate()
    ->format('U'), 0);
}