Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Response.php

function 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.

@final

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 may safely be kept in a shared (surrogate) cache.

File

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

Class

Response
Response represents an HTTP response.

Namespace

Symfony\Component\HttpFoundation

Code

public function isFresh() : bool {
    return $this->getTtl() > 0;
}
RSS feed
Powered by Drupal