Returns the response's time-to-live in seconds.
It returns null when no freshness information is present in the response.
When the responses TTL is <= 0, the response may not be served from cache without first revalidating with the origin.
@api
integer|null The TTL in seconds
public function getTtl() {
if (null !== ($maxAge = $this
->getMaxAge())) {
return $maxAge - $this
->getAge();
}
return null;
}