1 | <?php |
||
14 | class CacheStorage |
||
15 | { |
||
16 | /** @var int Default cache TTL */ |
||
17 | private $defaultTtl; |
||
18 | |||
19 | /** @var Cache */ |
||
20 | private $cache; |
||
21 | |||
22 | /** |
||
23 | * @param Cache $cache Cache backend. |
||
24 | * @param int $defaultTtl |
||
25 | */ |
||
26 | public function __construct(Cache $cache, $defaultTtl = 0) |
||
31 | |||
32 | public function cache(RequestInterface $request, ResponseInterface $response) |
||
44 | |||
45 | public function delete(RequestInterface $request) |
||
50 | |||
51 | public function fetch(RequestInterface $request) |
||
63 | |||
64 | /** |
||
65 | * Hash a request URL into a string that returns cache metadata |
||
66 | * |
||
67 | * @param RequestInterface $request |
||
68 | * |
||
69 | * @return string |
||
70 | */ |
||
71 | private function getCacheKey(RequestInterface $request) |
||
79 | } |