src/Guzzle/Plugin/Cache/DefaultRevalidation.php
protected function createRevalidationRequest(RequestInterface $request, Response $response)
    {
        $revalidate = clone $request;
        $revalidate->removeHeader('Pragma')->removeHeader('Cache-Control');

        if ($response->getLastModified()) {
            $revalidate->setHeader('If-Modified-Since', $response->getLastModified());
        }

        if ($response->getEtag()) {
            $revalidate->setHeader('If-None-Match', $response->getEtag());
        }

        // Remove any cache plugins that might be on the request to prevent infinite recursive revalidations
        $dispatcher = $revalidate->getEventDispatcher();
        foreach ($dispatcher->getListeners() as $eventName => $listeners) {
            foreach ($listeners as $listener) {
                if (is_array($listener) && $listener[0] instanceof CachePlugin) {
                    $dispatcher->removeListener($eventName, $listener);
                }
            }
        }

        return $revalidate;
    }
protected function createRevalidationRequest(RequestInterface $request, Response $response)
    {
        $revalidate = clone $request;
        $revalidate->removeHeader('Pragma')->removeHeader('Cache-Control');

        if ($response->getLastModified()) {
            $revalidate->setHeader('If-Modified-Since', $response->getLastModified());
        }

        if ($response->getEtag()) {
            $revalidate->setHeader('If-None-Match', $response->getEtag());
        }

        // Remove any cache plugins that might be on the request to prevent infinite recursive revalidations
        $dispatcher = $revalidate->getEventDispatcher();
        foreach ($dispatcher->getListeners() as $eventName => $listeners) {
            foreach ($listeners as $listener) {
                if (is_array($listener) && $listener[0] instanceof CachePlugin) {
                    $dispatcher->removeListener($eventName, $listener);
                }
            }
        }

        return $revalidate;
    }
protected function createRevalidationRequest ( RequestInterface $ request , Response $ response ) { $ revalidate = clone $ request ; $ revalidate -> removeHeader ( 'Pragma' ) -> removeHeader ( 'Cache-Control' ) ; if ( $ response -> getLastModified ( ) ) { $ revalidate -> setHeader ( 'If-Modified-Since' , $ response -> getLastModified ( ) ) ; } if ( $ response -> getEtag ( ) ) { $ revalidate -> setHeader ( 'If-None-Match' , $ response -> getEtag ( ) ) ; } // Remove any cache plugins that might be on the request to prevent infinite recursive revalidations $ dispatcher = $ revalidate -> getEventDispatcher ( ) ; foreach ( $ dispatcher -> getListeners ( ) as $ eventName => $ listeners ) { foreach ( $ listeners as $ listener ) { if ( is_array ( $ listener ) && $ listener [ 0 ] instanceof CachePlugin ) { $ dispatcher -> removeListener ( $ eventName , $ listener ) ; } } } return $ revalidate ; }
Creates a request to use for revalidation

@param RequestInterface $request  Request
@param Response         $response Response to revalidate

@return RequestInterface returns a revalidation request
Creates a request to use for revalidation