You are here

public function Response::getAge in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/Response.php \Symfony\Component\HttpFoundation\Response::getAge()

Returns the age of the response.

Return value

int The age of the response in seconds

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

File

vendor/symfony/http-foundation/Response.php, line 634

Class

Response
Response represents an HTTP response.

Namespace

Symfony\Component\HttpFoundation

Code

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