function Response::getTtl
Returns the response's time-to-live in seconds.
It returns null when no freshness information is present in the response.
When the response's TTL is 0, the response may not be served from cache without first revalidating with the origin.
@final
1 call to Response::getTtl()
- Response::isFresh in vendor/
symfony/ http-foundation/ Response.php - Returns true if the response is "fresh".
File
-
vendor/
symfony/ http-foundation/ Response.php, line 852
Class
- Response
- Response represents an HTTP response.
Namespace
Symfony\Component\HttpFoundationCode
public function getTtl() : ?int {
$maxAge = $this->getMaxAge();
return null !== $maxAge ? max($maxAge - $this->getAge(), 0) : null;
}