protected function getCacheTtl(Response $response)
    {
        if ($this->useHeaderTtl && $response->hasHeader('Cache-Control')) {
            $cacheControl =  $response->getHeader('Cache-Control')[0];

            if (preg_match('`max-age=(\d+)`', $cacheControl, $match)) {
                return intval($match[1]);
            }
        }

        return $this->defaultTtl;
    }
protected function getCacheTtl(Response $response)
    {
        if ($this->useHeaderTtl && $response->hasHeader('Cache-Control')) {
            $cacheControl =  $response->getHeader('Cache-Control')[0];

            if (preg_match('`max-age=(\d+)`', $cacheControl, $match)) {
                return intval($match[1]);
            }
        }

        return $this->defaultTtl;
    }
protected function getCacheTtl ( Response $ response ) { if ( $ this -> useHeaderTtl && $ response -> hasHeader ( 'Cache-Control' ) ) { $ cacheControl = $ response -> getHeader ( 'Cache-Control' ) [ 0 ] ; if ( preg_match ( '`max-age=(\d+)`' , $ cacheControl , $ match ) ) { return intval ( $ match [ 1 ] ) ; } } return $ this -> defaultTtl ; }
Get cache ttl value

@param Response $response

@return int
Get cache ttl value