protected function buildCacheDirectives($response)
    {
        $cacheControlHeader = null;
        if ($response->hasHeader('cache-control')) {
            $cacheControlHeader = $this->parseHeader($response->getHeader('cache-control'));
            $cacheControlHeader = current($cacheControlHeader);
            $cacheControlHeader = (isset($cacheControlHeader['max-age'])?$cacheControlHeader['max-age']:null);
        }

        $expiresHeader = null;
        if ($response->hasHeader('expires')){
            $expiresHeader = implode(' ',array_column($this->parseHeader($response->getHeader('expires')),0));
        }

        return array_filter([
            'maxAge'=>$cacheControlHeader,
            'expires'=>$expiresHeader,
        ]);
    }