src/ClientAdapters/GuzzleClientAdapter.php
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,
        ]);
    }
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,
        ]);
    }
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 , ] ) ; }
Builds the cache directives from response headers.

@param $response

@return string[]
Builds the cache directives from response headers .