-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Keep s-maxage when expiry and validation are used in combination #23130
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
Keep s-maxage when expiry and validation are used in combination #23130
Conversation
Should be rebased now :) |
…ould not defeat expiration on the combined response
Note to self: Don't open three different PRs at once that change the same part of code, will save yourself a lot of work. |
@fabpot rebased |
@mpdude Actually, that would have saved a lot of work for me as well :) At first, I didn't realized that the 3 PRs were about the same topic. In such a case, I generally ask to merge them all into one PR. |
I was unsure as to whether you agree that all three are bugs or correct behavior. |
Thank you @mpdude. |
…nation (mpdude) This PR was merged into the 2.7 branch. Discussion ---------- Keep s-maxage when expiry and validation are used in combination | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | (Symfony) docs say that [expiration wins over validation](https://symfony.com/doc/current/http_cache/validation.html). So, a) when both the master and embedded response are public with an s-maxage, the result should be public as well and use the lower s-maxage of both, *also* in the case that the embedded response carries validation headers. (The cache may use those for revalidating the embedded response once it has become stale, but that does not impact expiration-based caching of the combined response.) b) when both the master and embedded response are public with an s-maxage, the result should be public as well and use the lower s-maxage of both, *also* in the case that the master response carries validation headers. However, those *must not* be passed on to the client: They do not apply to the combined response, but may only be used by the cache itself to revalidate the (raw) master response. Commits ------- 09bcbc7 Embedding a response that combines expiration and validation, that should not defeat expiration on the combined response
@fabot Could you do me a favor and merge at least 2.7 into 2.8, if your processes allow it and it is no big deal? |
@mpdude Done! |
(Symfony) docs say that expiration wins over validation. So,
a) when both the master and embedded response are public with an s-maxage, the result should be public as well and use the lower s-maxage of both, also in the case that the embedded response carries validation headers. (The cache may use those for revalidating the embedded response once it has become stale, but that does not impact expiration-based caching of the combined response.)
b) when both the master and embedded response are public with an s-maxage, the result should be public as well and use the lower s-maxage of both, also in the case that the master response carries validation headers. However, those must not be passed on to the client: They do not apply to the combined response, but may only be used by the cache itself to revalidate the (raw) master response.