public function cache(RequestInterface $request, ResponseInterface $response)
{
$warningMessage = sprintf('%d - "%s" "%s"', 299, 'Cached although the response headers indicate not to do it!', (new \DateTime())->format(\DateTime::RFC1123));
$response = $response->withAddedHeader('Warning', $warningMessage);
if ($cacheObject = $this->getCacheObject($request, $response)) {
return $this->storage->save($this->getCacheKey($request), $cacheObject);
}
return false;
}