-
Notifications
You must be signed in to change notification settings - Fork 602
Add ignore_vary option #2318
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
base: master
Are you sure you want to change the base?
Add ignore_vary option #2318
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -664,6 +664,14 @@ HttpHeader::parse(const char *header_start, size_t hdrLen, Http::ContentLengthIn | |
| } | ||
| } | ||
|
|
||
| if (Config.onoff.ignore_vary) { | ||
| String rawVary; | ||
| if (getByIdIfPresent(Http::HdrType::VARY, &rawVary)) { | ||
| delById(Http::HdrType::VARY); | ||
|
Contributor
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. AFAICT, this low-level hack will trigger "no leftovers" assertion in Adaptation::Icap::ModXact::prepEchoing() if Most likely, this code should be moved to (i.e. triggered from) higher level code to avoid such difficult-to-find bugs. |
||
| debugs(55, 5, "Ignoring Vary: " << rawVary); | ||
| } | ||
| } | ||
|
|
||
| return 1; /* even if no fields where found, it is a valid header */ | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6969,6 +6969,24 @@ DOC_START | |
| varying objects not intended for caching to get cached. | ||
| DOC_END | ||
|
|
||
| NAME: ignore_vary | ||
| COMMENT: on|off | ||
| TYPE: onoff | ||
| LOC: Config.onoff.ignore_vary | ||
| DEFAULT: off | ||
| DOC_START | ||
| Some HTTP servers send a Vary header even though the clients | ||
| never send requests with different request headers. This | ||
| option causes Squid to completely ignore the Vary header and | ||
|
Contributor
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. I believe this description misleads the reader into thinking that Squid is just going to ignore the Vary header. In reality, Squid is going to delete that header upon receipt and, hence, never forward it. The header will not even appear in well-known level-2 response header dumps (as if it was never received)! Also, it may surprise some admins that Squid will send some Vary headers even if this directive is enabled (because Squid adds Vary to some of its generated responses). Please rephrase to clarify these effects of the proposed directive. Renaming the directive to P.S. AFAICT, the header is going to be counted in Squid named header statistics, arguably contradicting the "completely ignore" promise as well. |
||
| go ahead and cache the response using normal rules. | ||
|
Contributor
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. If you agree with the following assertion, please adjust PR description to explain that the proposed |
||
|
|
||
| WARNING: Doing this this VIOLATES the HTTP standard. Enabling | ||
|
Contributor
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. We should add |
||
| this can cause varying responses not intended for caching to get | ||
| cached. It is intended as a workaround until HTTP/1.1 is fully | ||
| implemented and only for use when client behavior is fully | ||
| controlled. | ||
| DOC_END | ||
|
Contributor
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. Please also document how the new |
||
|
|
||
| NAME: request_header_access | ||
| IFDEF: USE_HTTP_VIOLATIONS | ||
| TYPE: http_header_access | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either this code is missing
Http::HdrType::HDR_X_ACCELERATOR_VARYtreatment or the new directive documentation is missing a disclaimer about the difference in treatment of those two Vary-like headers (that are treated the same way in many other Squid contexts). The former is more likely.