src/Guzzle/Http/Message/Response.php
public function canCache()
    {
        // Check if the response is cacheable based on the code
        if (!in_array((int) $this->getStatusCode(), self::$cacheResponseCodes)) {
            return false;
        }

        // Make sure a valid body was returned and can be cached
        if ((!$this->getBody()->isReadable() || !$this->getBody()->isSeekable())
            && ($this->getContentLength() > 0 || $this->getTransferEncoding() == 'chunked')) {
            return false;
        }

        // Never cache no-store resources (this is a private cache, so private
        // can be cached)
        if ($this->getHeader('Cache-Control') && $this->getHeader('Cache-Control')->hasDirective('no-store')) {
            return false;
        }

        return $this->isFresh() || $this->getFreshness() === null || $this->canValidate();
    }
public function canCache()
    {
        // Check if the response is cacheable based on the code
        if (!in_array((int) $this->getStatusCode(), self::$cacheResponseCodes)) {
            return false;
        }

        // Make sure a valid body was returned and can be cached
        if ((!$this->getBody()->isReadable() || !$this->getBody()->isSeekable())
            && ($this->getContentLength() > 0 || $this->getTransferEncoding() == 'chunked')) {
            return false;
        }

        // Never cache no-store resources (this is a private cache, so private
        // can be cached)
        if ($this->getHeader('Cache-Control') && $this->getHeader('Cache-Control')->hasDirective('no-store')) {
            return false;
        }

        return $this->isFresh() || $this->getFreshness() === null || $this->canValidate();
    }
public function canCache ( ) { // Check if the response is cacheable based on the code if ( ! in_array ( ( int ) $ this -> getStatusCode ( ) , self :: $ cacheResponseCodes ) ) { return false ; } // Make sure a valid body was returned and can be cached if ( ( ! $ this -> getBody ( ) -> isReadable ( ) || ! $ this -> getBody ( ) -> isSeekable ( ) ) && ( $ this -> getContentLength ( ) > 0 || $ this -> getTransferEncoding ( ) == 'chunked' ) ) { return false ; } // Never cache no-store resources (this is a private cache, so private // can be cached) if ( $ this -> getHeader ( 'Cache-Control' ) && $ this -> getHeader ( 'Cache-Control' ) -> hasDirective ( 'no-store' ) ) { return false ; } return $ this -> isFresh ( ) || $ this -> getFreshness ( ) === null || $ this -> canValidate ( ) ; }
Check if the response can be cached based on the response headers

@return bool Returns TRUE if the response can be cached or false if not
Check if the response can be cached based on the response headers