Gets the number of seconds from the current time in which this response is still considered fresh
int|null Returns the number of seconds
public function getMaxAge() {
// s-max-age, then max-age, then Expires
if ($age = $this
->getCacheControlDirective('s-maxage')) {
return $age;
}
if ($age = $this
->getCacheControlDirective('max-age')) {
return $age;
}
if ($this
->getHeader('Expires')) {
return strtotime($this
->getExpires()) - time();
}
return null;
}