Get the freshness of the response by returning the difference of the maximum lifetime of the response and the age of the response (max-age - age).
Freshness values less than 0 mean that the response is no longer fresh and is ABS(freshness) seconds expired. Freshness values of greater than zero is the number of seconds until the response is no longer fresh. A NULL result means that no freshness information is available.
int
public function getFreshness() {
$maxAge = $this
->getMaxAge();
$age = $this
->getAge();
return $maxAge && $age ? $maxAge - $age : null;
}