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

Skip to content

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

Merged
merged 1 commit into from
Jun 14, 2017
Merged

Keep s-maxage when expiry and validation are used in combination #23130

merged 1 commit into from
Jun 14, 2017

Conversation

mpdude
Copy link
Contributor

@mpdude mpdude commented Jun 10, 2017

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. 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.

@mpdude mpdude changed the title Keep s-maxage when embedded response uses both expiry and validation Keep s-maxage when expiry and validation are used in combination Jun 10, 2017
@xabbuh xabbuh added this to the 2.7 milestone Jun 12, 2017
@mpdude
Copy link
Contributor Author

mpdude commented Jun 14, 2017

@fabpot Rebased to resolve conflicts after #23123 merge

@fabpot
Copy link
Member

fabpot commented Jun 14, 2017

Should be rebased now :)

…ould not defeat expiration on the combined response
@mpdude
Copy link
Contributor Author

mpdude commented Jun 14, 2017

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.

@mpdude
Copy link
Contributor Author

mpdude commented Jun 14, 2017

@fabpot rebased

@fabpot
Copy link
Member

fabpot commented Jun 14, 2017

@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.

@mpdude
Copy link
Contributor Author

mpdude commented Jun 14, 2017

I was unsure as to whether you agree that all three are bugs or correct behavior.

@fabpot
Copy link
Member

fabpot commented Jun 14, 2017

Thank you @mpdude.

@fabpot fabpot merged commit 09bcbc7 into symfony:2.7 Jun 14, 2017
fabpot added a commit that referenced this pull request Jun 14, 2017
…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
@mpdude mpdude deleted the expiry-wins-over-validation-so-cache-it branch June 14, 2017 22:32
@mpdude
Copy link
Contributor Author

mpdude commented Jun 20, 2017

@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?

@fabpot
Copy link
Member

fabpot commented Jun 20, 2017

@mpdude Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants