src/Utils.php
public static function getMaxAge(ResponseInterface $response)
    {
        $smaxage = Utils::getDirective($response, 's-maxage');
        if (is_numeric($smaxage)) {
            return (int) $smaxage;
        }

        $maxage = Utils::getDirective($response, 'max-age');
        if (is_numeric($maxage)) {
            return (int) $maxage;
        }

        if ($response->hasHeader('Expires')) {
            return strtotime($response->getHeader('Expires')) - time();
        }

        return null;
    }
public static function getMaxAge(ResponseInterface $response)
    {
        $smaxage = Utils::getDirective($response, 's-maxage');
        if (is_numeric($smaxage)) {
            return (int) $smaxage;
        }

        $maxage = Utils::getDirective($response, 'max-age');
        if (is_numeric($maxage)) {
            return (int) $maxage;
        }

        if ($response->hasHeader('Expires')) {
            return strtotime($response->getHeader('Expires')) - time();
        }

        return null;
    }
public static function getMaxAge ( ResponseInterface $ response ) { $ smaxage = Utils :: getDirective ( $ response , 's-maxage' ) ; if ( is_numeric ( $ smaxage ) ) { return ( int ) $ smaxage ; } $ maxage = Utils :: getDirective ( $ response , 'max-age' ) ; if ( is_numeric ( $ maxage ) ) { return ( int ) $ maxage ; } if ( $ response -> hasHeader ( 'Expires' ) ) { return strtotime ( $ response -> getHeader ( 'Expires' ) ) - time ( ) ; } return null ; }
Gets the number of seconds from the current time in which a response
is still considered fresh.

@param ResponseInterface $response

@return int|null Returns the number of seconds
Gets the number of seconds from the current time in which a response is still considered fresh .