1: <?php
2:
3: namespace Guzzle\Plugin\Cache;
4:
5: use Guzzle\Http\Message\RequestInterface;
6: use Guzzle\Http\Message\Response;
7:
8: /**
9: * Default strategy used to determine of an HTTP request can be cached
10: */
11: class DefaultCanCacheStrategy implements CanCacheStrategyInterface
12: {
13: /**
14: * {@inheritdoc}
15: */
16: public function canCacheRequest(RequestInterface $request)
17: {
18: return $request->canCache();
19: }
20:
21: /**
22: * {@inheritdoc}
23: */
24: public function canCacheResponse(Response $response)
25: {
26: return $response->isSuccessful() && $response->canCache();
27: }
28: }
29: