$storage
$storage : \Guzzle\Plugin\Cache\CacheStorageInterface
Default revalidation strategy
$storage : \Guzzle\Plugin\Cache\CacheStorageInterface
$canCache : \Guzzle\Plugin\Cache\CanCacheStrategyInterface
__construct(\Guzzle\Plugin\Cache\CacheStorageInterface $cache, \Guzzle\Plugin\Cache\CanCacheStrategyInterface $canCache = null)
\Guzzle\Plugin\Cache\CacheStorageInterface | $cache | Cache storage |
\Guzzle\Plugin\Cache\CanCacheStrategyInterface | $canCache | Determines if a message can be cached |
revalidate(\Guzzle\Http\Message\RequestInterface $request, \Guzzle\Http\Message\Response $response) : boolean
Performs a cache revalidation
\Guzzle\Http\Message\RequestInterface | $request | Request to revalidate |
\Guzzle\Http\Message\Response | $response | Response that was received |
Returns true if the request can be cached
shouldRevalidate(\Guzzle\Http\Message\RequestInterface $request, \Guzzle\Http\Message\Response $response) : boolean
Returns true if the response should be revalidated
\Guzzle\Http\Message\RequestInterface | $request | Request to check |
\Guzzle\Http\Message\Response | $response | Response to check |
handleBadResponse(\Guzzle\Http\Exception\BadResponseException $e)
Handles a bad response when attempting to revalidate
\Guzzle\Http\Exception\BadResponseException | $e | Exception encountered |
createRevalidationRequest(\Guzzle\Http\Message\RequestInterface $request, \Guzzle\Http\Message\Response $response) : \Guzzle\Http\Message\RequestInterface
Creates a request to use for revalidation
\Guzzle\Http\Message\RequestInterface | $request | Request |
\Guzzle\Http\Message\Response | $response | Response to revalidate |
returns a revalidation request
handle200Response(\Guzzle\Http\Message\RequestInterface $request, \Guzzle\Http\Message\Response $validateResponse) : boolean
Handles a 200 response response from revalidating. The server does not support validation, so use this response.
\Guzzle\Http\Message\RequestInterface | $request | Request that was sent |
\Guzzle\Http\Message\Response | $validateResponse | Response received |
Returns true if valid, false if invalid
handle304Response(\Guzzle\Http\Message\RequestInterface $request, \Guzzle\Http\Message\Response $validateResponse, \Guzzle\Http\Message\Response $response) : boolean
Handle a 304 response and ensure that it is still valid
\Guzzle\Http\Message\RequestInterface | $request | Request that was sent |
\Guzzle\Http\Message\Response | $validateResponse | Response received |
\Guzzle\Http\Message\Response | $response | Original cached response |
Returns true if valid, false if invalid