You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficserver.apache.org by "Bryan Call (JIRA)" <ji...@apache.org> on 2013/10/11 20:34:43 UTC

[jira] [Comment Edited] (TS-2245) Fix the semantics and behavior of e.g. proxy.config.http.cache.ignore_accept_encoding_mismatch

    [ https://issues.apache.org/jira/browse/TS-2245?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13792924#comment-13792924 ] 

Bryan Call edited comment on TS-2245 at 10/11/13 6:34 PM:
----------------------------------------------------------

According to the HTTP/1.1 RFC if the Accept and Content-Type can't be matched it "SHOULD" respond back with a 406.

{code}
If no Accept header field is present, then it is assumed that the client accepts all media types. If an Accept header field is present, and if the server cannot send a response which is acceptable according to the combined Accept field value, then the server SHOULD send a 406 (not acceptable) response.
{code}
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

Having the existing logic is good for proxy.config.http.cache.ignore_accept_mismatch, but we should look into ways it can be improved with more configurable options.


was (Author: bcall):
According to the HTTP/1.1 RFC if the Accept and Content-Type can't be matched it "SHOULD" respond back with a 406.

{code}
If no Accept header field is present, then it is assumed that the client accepts all media types. If an Accept header field is present, and if the server cannot send a response which is acceptable according to the combined Accept field value, then the server SHOULD send a 406 (not acceptable) response.
{code}
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

Have the existing logic is good for proxy.config.http.cache.ignore_accept_mismatch, but we should look into ways it can be improved with more configurable options.

> Fix the semantics and behavior of e.g. proxy.config.http.cache.ignore_accept_encoding_mismatch
> ----------------------------------------------------------------------------------------------
>
>                 Key: TS-2245
>                 URL: https://issues.apache.org/jira/browse/TS-2245
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: HTTP
>            Reporter: Leif Hedstrom
>            Assignee: Leif Hedstrom
>             Fix For: 5.0.0
>
>
> These four configurations options where added to fix a real problem (content duplications in cache): 
> {code}
>   {RECT_CONFIG, "proxy.config.http.cache.ignore_accept_mismatch", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
>   ,
>   {RECT_CONFIG, "proxy.config.http.cache.ignore_accept_language_mismatch", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
>   ,
>   {RECT_CONFIG, "proxy.config.http.cache.ignore_accept_encoding_mismatch", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
>   ,
>   {RECT_CONFIG, "proxy.config.http.cache.ignore_accept_charset_mismatch", RECD_INT, "0", RECU_DYNAMIC, RR_NULL, RECC_INT, "[0-1]", RECA_NULL}
>   ,
> {code}
> However, as implemented, they are pretty much useless, and if enabled, have high risk of giving wrong content. To make things worse, they are global configurations, since they are not passable from the HTTPSM into the cache.
> I've examine the code thoroughly, and I actually think these configurations had the right intentions, but just implemented it wrong. What they really ought to have been is e.g. proxy.config.http.cache.relax_accept_encoding_match .
> What *should* happen (IMO) is that these four configs (ideally we'd rename them or make new ones) would check if there is no Vary: header in the cached entry. IF there is no Vary: header, *AND* one of these settings it set, we skip that matching that happens on the cache client header and the incoming client header entirely (give the match a score of 1.0). These configs should ideally also be per-remap overridable, but that requires code changes like TS-1919.
> A real use case scenario is this: Assume a content is always served by origin without Content-Encoding, or Vary: header. This would be typical for e.g. a PNG (image).
> Upon cache miss, if the first request comes with Accept-Encoding: gzip, everything is fine, and we serve this cached item to all clients thereafter. However, if the first request comes with no Accept-Encoding: header whatsoever, that response can not satisfy a response from a request with AE: gzip, so we get *at least* two copies of the same object in cache.
> I'm curious to get some input on this, and let me know if the explanations makes no sense. :)



--
This message was sent by Atlassian JIRA
(v6.1#6144)