Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Minor cleanups in HttpCache, especially centralize Date header fixup#22033

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
mpdude wants to merge6 commits intosymfony:2.8fromwebfactory:http-cache-cleanup-date
Closed

Minor cleanups in HttpCache, especially centralize Date header fixup#22033

mpdude wants to merge6 commits intosymfony:2.8fromwebfactory:http-cache-cleanup-date

Conversation

@mpdude
Copy link
Contributor

QA
Branch?2.8
Bug fix?yes
New feature?no
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets
LicenseMIT
Doc PR

I am trying to hunt some issues where the HTTP cache does not revalidate responses (or does not use a cached response?) in the edge case of havings-maxage = 0 and possibly a backend that's slow to respond.

I don't see yet what exactly my problem is there, but it must somehow be related with theDate header handling and/or age calculations in theHTTPCache.

As a first step, I'd like to suggest this cleanup inHTTPCache. Especially, it would be helpful if we could make sure that there is just one place where we set theDate header if the backend does not send one (?). This makes sure we always have this header to base later age calculations on it.

This makes use of the fact that all requests to the backend go through this method.Backends should provide a Date header indicating the time at which the responsewas generated. But if (for whatever reason) they don't, we'll keep the timeat which the response was received as the response Date.To-Do: Review the RFC; it probably suggests using the time at which the requestwas initiated, not the time the response was received.
@Nek-
Copy link
Contributor

Nek- commentedMar 17, 2017
edited
Loading

Thanks for your contribution. 😄

Is it possible to add a test case that exposes this issue?

@mpdude
Copy link
ContributorAuthor

I will add that once I have found/understood it.

For now, this PR is intended as a refactoring that helps (at least me) to better follow execution paths through theHttpCache.

@mpdude
Copy link
ContributorAuthor

mpdude commentedMar 17, 2017
edited
Loading

#19390 added a check in theHttpCache::store() method to make sure we have aDate header. As all requests go throughforward(), to me this seems to be the better place.

@mpdude
Copy link
ContributorAuthor

@Nek- the test in#22043 comes close

@fabpot
Copy link
Member

merging into master as this is not really a bug fix

@fabpot
Copy link
Member

Thank you@mpdude.

@fabpotfabpot closed thisMar 22, 2017
fabpot added a commit that referenced this pull requestMar 22, 2017
…header fixup (mpdude)This PR was submitted for the 2.8 branch but it was merged into the 3.3-dev branch instead (closes#22033).Discussion----------Minor cleanups in HttpCache, especially centralize Date header fixup| Q             | A| ------------- | ---| Branch?       | 2.8| Bug fix?      | yes| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets || License       | MIT| Doc PR        |I am trying to hunt some issues where the HTTP cache does not revalidate responses (or does not use a cached response?) in the edge case of having `s-maxage = 0` and possibly a backend that's slow to respond.I don't see yet what exactly my problem is there, but it must somehow be related with the `Date` header handling and/or age calculations in the `HTTPCache`.As a first step, I'd like to suggest this cleanup in `HTTPCache`. Especially, it would be helpful if we could make sure that there is just one place where we set the `Date` header if the backend does not send one (?). This makes sure we always have this header to base later age calculations on it.Commits-------30639c6 Minor cleanups in HttpCache, especially centralize Date header fixup
fabpot added a commit that referenced this pull requestMar 22, 2017
… (first?) test for it (mpdude)This PR was squashed before being merged into the 3.3-dev branch (closes#22043).Discussion----------Refactor stale-while-revalidate code in HttpCache, add a (first?) test for it| Q             | A| ------------- | ---| Branch?       | 2.8| Bug fix?      | no| New feature?  | no| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets || License       | MIT| Doc PR        |I came up with this while trying to hunt a production bug related to handling of stale cache entries under the condition of a busy backend (also see#22033).It's just a refactoring to make the code more readable plus a new test.Commits-------b14057c Refactor stale-while-revalidate code in HttpCache, add a (first?) test for it
@mpdudempdude deleted the http-cache-cleanup-date branchMarch 23, 2017 05:35
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Projects

None yet

Milestone

2.8

Development

Successfully merging this pull request may close these issues.

5 participants

@mpdude@Nek-@fabpot@nicolas-grekas@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp