public function Response::isFresh

Same name in this branch

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 Expiration header and the calculated age is less than the freshness lifetime.

@api

Return value

Boolean true if the response is fresh, false otherwise

2 calls to Response::isFresh()

File

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

Class

Response
Response represents an HTTP response.

Namespace

Symfony\Component\HttpFoundation

Code

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