Re: #428 Accept-Language ordering for identical qvalues

Amos Jeffries <> Tue, 22 January 2013 10:26 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id D52C521F8901 for <>; Tue, 22 Jan 2013 02:26:22 -0800 (PST)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -9.024
X-Spam-Status: No, score=-9.024 tagged_above=-999 required=5 tests=[AWL=0.375, BAYES_00=-2.599, J_CHICKENPOX_47=0.6, J_CHICKENPOX_74=0.6, RCVD_IN_DNSWL_HI=-8]
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id FpGmh6med6Wc for <>; Tue, 22 Jan 2013 02:26:22 -0800 (PST)
Received: from ( []) by (Postfix) with ESMTP id 521A421F8800 for <>; Tue, 22 Jan 2013 02:26:22 -0800 (PST)
Received: from lists by with local (Exim 4.72) (envelope-from <>) id 1Txb2l-00011s-5x for; Tue, 22 Jan 2013 10:25:27 +0000
Resent-Date: Tue, 22 Jan 2013 10:25:27 +0000
Resent-Message-Id: <>
Received: from ([]) by with esmtp (Exim 4.72) (envelope-from <>) id 1Txb2e-00010e-JO for; Tue, 22 Jan 2013 10:25:20 +0000
Received: from ([] by with esmtp (Exim 4.72) (envelope-from <>) id 1Txb2d-0006nE-Ov for; Tue, 22 Jan 2013 10:25:20 +0000
Received: from [] (unknown []) by (Postfix) with ESMTP id 79099E72D6 for <>; Tue, 22 Jan 2013 23:24:56 +1300 (NZDT)
Message-ID: <>
Date: Tue, 22 Jan 2013 23:24:52 +1300
From: Amos Jeffries <>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2
MIME-Version: 1.0
References: <emd05c9b5b-e16a-43b5-aabc-a744298d5527@bombed>
In-Reply-To: <emd05c9b5b-e16a-43b5-aabc-a744298d5527@bombed>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Received-SPF: pass client-ip=;;
X-W3C-Hub-Spam-Status: No, score=-3.2
X-W3C-Hub-Spam-Report: AWL=-3.184, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001
X-W3C-Scan-Sig: 1Txb2d-0006nE-Ov dd431d9a17fb64487e0044d0d5173e0d
Subject: Re: #428 Accept-Language ordering for identical qvalues
Archived-At: <>
X-Mailing-List: <> archive/latest/16102
Precedence: list
List-Id: <>
List-Help: <>
List-Post: <>
List-Unsubscribe: <>

On 22/01/2013 10:30 p.m., Adrien W. de Croy wrote:
> Just wondering if there is anything to be discussed about Accept-Encoding.
> There are some cases where it can cause issues for a cache.
> for example
> GET /something HTTP/1.1
> Host:
> Accept-Encoding: gzip, deflate
> 200 OK HTTP/1.1
> Content-Encoding: gzip
> Cache-Control: max-age=2000000
> Vary: Accept-Encoding
> GET /something HTTP/1.1
> Host:
> Accept-Encoding: deflate, gzip
> cache MUST NOT select 1st response due to difference in 
> Accept-Encoding header between requests.  Even though there's arguably 
> no semantic difference.

I'm interested in where that "MUST NOT" comes from. My understanding was 
that in the cache role we could take the Content-Encoding header on the 
stored reply as the variant key on the vary response to match against 
the new client Accept-Encoding entries and serve up the HIT if we really 
wanted to.

> I've never seen a q value on Accept-Encoding, and the spec talks 
> about transforming headers as part of matching, but it only allows 
> adding / removal of LWS and combining multiples. Not re-ordering.
> I know there's the pathological case about something returning the 
> headers of the request, but it seems like a big price to pay for this.
> Maybe all browser vendors should always order Accept-Encoding tokens 
> in the same order.

But this is a case of a metric where the browser agent *can* usually 
determine ordering automatically.

For example; deflate, gzip, and friends have different CPU consumption 
and bandwidth saving profiles. The browser can get access to the clients 
own CPU and uplink properties to determine whether it needs to proritize 
deflate,gzip or gzip,deflate. Having both indicated shows that either 
format response is acceptible, but the more responses this client gets 
in the first-listed entry the better the user experience.