Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e5a131b

Browse files
committed
Consider response not cacheable when the master response is not cacheable
This just adds the same logic to the master response that is applied for embedded responses in the ResponseCacheStrategy::add() method. This is sufficient to fix the current bug without causing regressions (in terms of available tests). Note that is probably too strict when it comes to merging private responses: The Response::isCacheable() method deals with cacheability in shared (surrogate) caches, whereas ResponseCacheStrategy is about merging multiple responses together during ESI/SSI processing.
1 parent 85212b0 commit e5a131b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/HttpKernel/HttpCache/ResponseCacheStrategy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public function update(Response $response)
7272
$response->setLastModified(null);
7373
}
7474

75-
if (!$response->isFresh()) {
75+
if (!$response->isFresh() || !$response->isCacheable()) {
7676
$this->cacheable = false;
7777
}
7878

0 commit comments

Comments
 (0)