You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by Igor Galić <i....@brainsware.org> on 2013/11/05 22:57:33 UTC

Re: [1/2] git commit: TS-2245 This adds a '2' config state to the ignore mismatch configs


----- Original Message -----
> Updated Branches:
>   refs/heads/master 09fcb8da4 -> 7ddc44f74
> 
> 
> TS-2245 This adds a '2' config state to the ignore mismatch configs
> 
> This is completley backwards compatible, but adds a new feature which
> allows a much more sane behavior for these configs:
> 
>   proxy.config.http.cache.ignore_accept_mismatch
>   proxy.config.http.cache.ignore_accept_language_mismatch
>   proxy.config.http.cache.ignore_accept_encoding_mismatch
>   proxy.config.http.cache.ignore_accept_charset_mismatch
> 
> Setting any of these to the value '2' will now ignore the
> respective client request header, but *only* if the cached
> response does not have a Vary: header.
> 
> The old documentation seemed to imply that this would be
> the case, but it was never so. Setting any of these to "1"
> would simply ignore whatever the Vary: header says.
> 
> 
> Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
> Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/70815db3
> Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/70815db3
> Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/70815db3
> 
> Branch: refs/heads/master
> Commit: 70815db3b237d5e572ff9bc0a4df81d64157ba92
> Parents: 09fcb8d
> Author: Leif Hedstrom <zw...@apache.org>
> Authored: Sun Oct 27 15:22:42 2013 -0600
> Committer: Leif Hedstrom <zw...@apache.org>
> Committed: Tue Nov 5 08:15:51 2013 -0700
> 
> ----------------------------------------------------------------------
>  .../configuration/records.config.en.rst         |  67 +++++++---
>  mgmt/RecordsConfig.cc                           |   8 +-
>  proxy/http/HttpConfig.cc                        |   8 +-
>  proxy/http/HttpSM.cc                            |   8 +-
>  proxy/http/HttpTransactCache.cc                 | 127 +++++++++++--------
>  proxy/http/HttpTransactCache.h                  |  16 +--
>  6 files changed, 140 insertions(+), 94 deletions(-)
> ----------------------------------------------------------------------
> 
> 
> http://git-wip-us.apache.org/repos/asf/trafficserver/blob/70815db3/doc/reference/configuration/records.config.en.rst
> ----------------------------------------------------------------------
> diff --git a/doc/reference/configuration/records.config.en.rst
> b/doc/reference/configuration/records.config.en.rst
> index f1f0c0c..3917048 100644
> --- a/doc/reference/configuration/records.config.en.rst
> +++ b/doc/reference/configuration/records.config.en.rst
> @@ -1061,45 +1061,76 @@ Cache Control
>  .. ts:cv:: CONFIG proxy.config.http.cache.ignore_accept_mismatch INT 0
>     :reloadable:
>  
> -   When enabled (``1``), Traffic Server serves documents from cache with a
> ``Content-Type:`` header that does not match the ``Accept:``
> -   header of the request.
> +   When with a value of ``1``, Traffic Server serves documents from cache
> with a
> +   ``Content-Type:`` header that does not match the ``Accept:`` header of
> the
> +   request. If set to ``2``, this logic only happens in the absence of a
> +   ``Vary`` header in the cached response (which is the recommended and safe
> use).
>  
>     .. note::
> +      This option should only be enabled with ``1`` if you're having
> +      problems with caching *and* you origin server doesn't set the ``Vary``
> +      header. Alternatively, if the origin is incorrectly setting
> +      ``Vary: Accept`` or doesn't respond with ``406 (Not Acceptable)``,
> +      you can also enable this configuration with a ``1`.
> +
>  
> -      This option should only be enabled if you're having
> -      problems with caching *and* one of the following is true:
> +.. ts:cv:: CONFIG proxy.config.http.cache.ignore_accept_language_mismatch
> INT 0
> +   :reloadable:
>  
> -      -  Your origin server sets ``Vary: Accept`` when doing content
> negotiation with ``Accept`` *OR*
> -      -  The server does not send a ``406 (Not Acceptable)`` response for
> types that it cannot serve.
> +   When enabled with a value of ``1``, Traffic Server serves documents from
> cache with a
> +   ``Content-Language:`` header that does not match the ``Accept-Language:``
> +   header of the request. If set to ``2``, this logic only happens in the
> absence of a
> +   ``Vary`` header in the cached response (which is the recommended and safe
> use).
>  


I'm a little unhappy with this wording. Do you think that

   When enabled with a value of ``1``, Traffic Server serves documents from
   cache with a ``Content-Language:`` header even if it does not match the
   ``Accept-Language:`` header of the request.

[snip]

-- 
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.galic@brainsware.org
URL: http://brainsware.org/
GPG: 8716 7A9F 989B ABD5 100F  4008 F266 55D6 2998 1641


Re: [1/2] git commit: TS-2245 This adds a '2' config state to the ignore mismatch configs

Posted by Leif Hedstrom <zw...@apache.org>.
On Nov 5, 2013, at 1:57 PM, Igor Galić <i....@brainsware.org> wrote:

> 
> 
>> +   header of the request. If set to ``2``, this logic only happens in the
>> absence of a
>> +   ``Vary`` header in the cached response (which is the recommended and safe
>> use).
>> 
> 
> 
> I'm a little unhappy with this wording. Do you think that
> 
>   When enabled with a value of ``1``, Traffic Server serves documents from
>   cache with a ``Content-Language:`` header even if it does not match the
>   ``Accept-Language:`` header of the request.



Yes, that sounds better. Please feel free to fix it.

— Leif