*/
public function add(Response $response)
{
- if ($response->isValidateable()) {
+ if (!$response->isFresh() || !$response->isCacheable()) {
$this->cacheable = false;
} else {
$maxAge = $response->getMaxAge();
if ($response->isValidateable()) {
$response->setEtag(null);
$response->setLastModified(null);
+ }
+
+ if (!$response->isFresh() || !$response->isCacheable()) {
$this->cacheable = false;
}