-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpKernel] Keep max lifetime also when part of the responses don't set it #41665
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
…resulting response
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -370,7 +370,7 @@ public function cacheControlMergingProvider() | |
]; | ||
|
||
yield 'merge max-age and s-maxage' => [ | ||
['public' => true, 's-maxage' => '60', 'max-age' => null], | ||
['public' => true, 'max-age' => '60'], | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Short explanation what happens here: Previously, not all responses had With this change, the |
||
['public' => true, 's-maxage' => 3600], | ||
[ | ||
['public' => true, 'max-age' => 60], | ||
|
@@ -393,6 +393,30 @@ public function cacheControlMergingProvider() | |
], | ||
]; | ||
|
||
yield 'public subresponse without lifetime does not remove lifetime for main response' => [ | ||
['public' => true, 's-maxage' => '30', 'max-age' => null], | ||
['public' => true, 's-maxage' => '30'], | ||
[ | ||
['public' => true], | ||
], | ||
]; | ||
|
||
yield 'lifetime for subresponse is kept when main response has no lifetime' => [ | ||
['public' => true, 'max-age' => '30'], | ||
['public' => true], | ||
[ | ||
['public' => true, 'max-age' => '30'], | ||
], | ||
]; | ||
|
||
yield 's-maxage on the subresponse implies public, so the result is public as well' => [ | ||
['public' => true, 'max-age' => '10', 's-maxage' => null], | ||
['public' => true, 'max-age' => '10'], | ||
[ | ||
['max-age' => '30', 's-maxage' => '20'], | ||
], | ||
]; | ||
|
||
yield 'result is private when combining private responses' => [ | ||
['no-cache' => false, 'must-revalidate' => false, 'private' => true], | ||
['s-maxage' => 60, 'private' => true], | ||
|
Uh oh!
There was an error while loading. Please reload this page.