public function Response::getFreshness

Get the freshness of the response by returning the difference of the maximum lifetime of the response and the age of the response (max-age - age).

Freshness values less than 0 mean that the response is no longer fresh and is ABS(freshness) seconds expired. Freshness values of greater than zero is the number of seconds until the response is no longer fresh. A NULL result means that no freshness information is available.

Return value

int

2 calls to Response::getFreshness()
Response::canCache in drupal/core/vendor/guzzle/http/Guzzle/Http/Message/Response.php
Check if the response can be cached
Response::isFresh in drupal/core/vendor/guzzle/http/Guzzle/Http/Message/Response.php
Check if the response is considered fresh.

File

drupal/core/vendor/guzzle/http/Guzzle/Http/Message/Response.php, line 879

Class

Response
Guzzle HTTP response object

Namespace

Guzzle\Http\Message

Code

public function getFreshness() {
  $maxAge = $this
    ->getMaxAge();
  $age = $this
    ->getAge();
  return $maxAge && $age ? $maxAge - $age : null;
}