src/CachePlugin.php
protected function getCacheControlDirective(ResponseInterface $response, string $name)
    {
        foreach ($response->getHeader('Cache-Control') as $header) {
            if (preg_match(sprintf('|%s=?([0-9]+)?|i', $name), $header, $matches)) {
                // return the value for $name if it exists
                if (isset($matches[1])) {
                    return $matches[1];
                }

                return true;
            }
        }

        return false;
    }
protected function getCacheControlDirective(ResponseInterface $response, string $name)
    {
        foreach ($response->getHeader('Cache-Control') as $header) {
            if (preg_match(sprintf('|%s=?([0-9]+)?|i', $name), $header, $matches)) {
                // return the value for $name if it exists
                if (isset($matches[1])) {
                    return $matches[1];
                }

                return true;
            }
        }

        return false;
    }
protected function getCacheControlDirective ( ResponseInterface $ response , string $ name ) { foreach ( $ response -> getHeader ( 'Cache-Control' ) as $ header ) { if ( preg_match ( sprintf ( '|%s=?([0-9]+)?|i' , $ name ) , $ header , $ matches ) ) { // return the value for $name if it exists if ( isset ( $ matches [ 1 ] ) ) { return $ matches [ 1 ] ; } return true ; } } return false ; }
Get the value of a parameter in the cache control header.

@param \Psr\Http\Message\ResponseInterface $response
@param string                              $name

@return bool|string
Get the value of a parameter in the cache control header .