diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ace4f07769..cdf4fb25b02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ CHANGELOG for Sulu ================== * release/1.5 + * BUGFIX #4385 [SuluHttpCacheBundle] Fix usage of symfony cache with s-max-age 0 * ENHANCEMENT #4367 [WebsiteBundle] Remove false deprecation of WebsiteController::renderStructure * BUGFIX #4376 [SecurityBundle] Exclude role permissions in user API to improve performance diff --git a/src/Sulu/Component/HttpCache/Handler/PublicHandler.php b/src/Sulu/Component/HttpCache/Handler/PublicHandler.php index 4b08a3da328..b6d35c36727 100644 --- a/src/Sulu/Component/HttpCache/Handler/PublicHandler.php +++ b/src/Sulu/Component/HttpCache/Handler/PublicHandler.php @@ -85,9 +85,13 @@ public function updateResponse(Response $response, StructureInterface $structure // mark the response as either public or private $response->setPublic(); - // set the private and shared max age + // set the private max age $response->setMaxAge($this->maxAge); - $response->setSharedMaxAge($this->sharedMaxAge); + + // set shared max age only when not 0 else symfony cache will not work + if ($this->sharedMaxAge) { + $response->setSharedMaxAge($this->sharedMaxAge); + } $proxyTtl = $this->usePageTtl ? $response->getAge() + $cacheLifetime :