src/Guzzle/Plugin/Cache/CachePlugin.php
public function onRequestSent(Event $event)
    {
        $request = $event['request'];
        $response = $event['response'];

        if ($request->getParams()->get('cache.hit') === null &&
            $this->canCache->canCacheRequest($request) &&
            $this->canCache->canCacheResponse($response)
        ) {
            $this->storage->cache($request, $response);
        }

        $this->addResponseHeaders($request, $response);
    }
public function onRequestSent(Event $event)
    {
        $request = $event['request'];
        $response = $event['response'];

        if ($request->getParams()->get('cache.hit') === null &&
            $this->canCache->canCacheRequest($request) &&
            $this->canCache->canCacheResponse($response)
        ) {
            $this->storage->cache($request, $response);
        }

        $this->addResponseHeaders($request, $response);
    }
public function onRequestSent ( Event $ event ) { $ request = $ event [ 'request' ] ; $ response = $ event [ 'response' ] ; if ( $ request -> getParams ( ) -> get ( 'cache.hit' ) === null && $ this -> canCache -> canCacheRequest ( $ request ) && $ this -> canCache -> canCacheResponse ( $ response ) ) { $ this -> storage -> cache ( $ request , $ response ) ; } $ this -> addResponseHeaders ( $ request , $ response ) ; }
If possible, store a response in cache after sending

@param Event $event
If possible store a response in cache after sending