diff --git a/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php b/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php index 0b97d8dfa5..cadbfa9f83 100644 --- a/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php +++ b/src/Symfony/Component/HttpKernel/HttpCache/HttpCache.php @@ -180,7 +180,7 @@ class HttpCache implements HttpKernelInterface */ protected function addEsiTtl(Response $response) { - $this->esiTtls[] = $response->isValidateable() ? 0 : $response->getTtl(); + $this->esiTtls[] = $response->isValidateable() ? -1 : $response->getTtl(); } /** @@ -192,10 +192,11 @@ class HttpCache implements HttpKernelInterface protected function updateResponseCacheControl(Response $response) { $ttl = min($this->esiTtls); - if (0 === $ttl) { + if (-1 === $ttl) { $response->headers->set('Cache-Control', 'no-cache, must-revalidate'); } else { $response->setSharedMaxAge($ttl); + $response->setMaxAge(0); } }