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\HttpFoundationCode
public function isFresh() : bool {
return $this->getTtl() > 0;
}