You are here

public function Response::isFresh in Zircon Profile 8.0

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

Returns true if the response is "fresh".

Fresh responses may be served from cache without any interaction with the origin. A response is considered fresh when it includes a Cache-Control/max-age indicator or Expires header and the calculated age is less than the freshness lifetime.

Return value

bool true if the response is fresh, false otherwise

2 calls to Response::isFresh()
Response::expire in vendor/symfony/http-foundation/Response.php
Marks the response stale by setting the Age header to be equal to the maximum age of the response.
Response::isCacheable in vendor/symfony/http-foundation/Response.php
Returns true if the response is worth caching under any circumstance.

File

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

Class

Response
Response represents an HTTP response.

Namespace

Symfony\Component\HttpFoundation

Code

public function isFresh() {
  return $this
    ->getTtl() > 0;
}