Re: #337: Field names in cache-control header arguments

Amos Jeffries <squid3@treenet.co.nz> Mon, 13 February 2012 13:29 UTC

Return-Path: <ietf-http-wg-request@listhub.w3.org>
X-Original-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Delivered-To: ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 0BC6B21F84D1 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 13 Feb 2012 05:29:17 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -9.878
X-Spam-Level:
X-Spam-Status: No, score=-9.878 tagged_above=-999 required=5 tests=[AWL=0.721, BAYES_00=-2.599, RCVD_IN_DNSWL_HI=-8]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id sL-pjyJog+sO for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 13 Feb 2012 05:29:16 -0800 (PST)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) by ietfa.amsl.com (Postfix) with ESMTP id 3FF6121F84CF for <httpbisa-archive-bis2Juki@lists.ietf.org>; Mon, 13 Feb 2012 05:29:15 -0800 (PST)
Received: from lists by frink.w3.org with local (Exim 4.69) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1Rwvwf-0001ud-Om for ietf-http-wg-dist@listhub.w3.org; Mon, 13 Feb 2012 13:27:53 +0000
Received: from maggie.w3.org ([128.30.52.39]) by frink.w3.org with esmtp (Exim 4.69) (envelope-from <squid3@treenet.co.nz>) id 1RwvwQ-0001tm-Th for ietf-http-wg@listhub.w3.org; Mon, 13 Feb 2012 13:27:38 +0000
Received: from ip-58-28-153-233.static-xdsl.xnet.co.nz ([58.28.153.233] helo=treenet.co.nz) by maggie.w3.org with esmtp (Exim 4.72) (envelope-from <squid3@treenet.co.nz>) id 1RwvwN-0005Eh-30 for ietf-http-wg@w3.org; Mon, 13 Feb 2012 13:27:38 +0000
Received: from [10.1.1.14] (unknown [119.224.40.49]) by treenet.co.nz (Postfix) with ESMTP id 11B61E6EE5 for <ietf-http-wg@w3.org>; Tue, 14 Feb 2012 02:27:11 +1300 (NZDT)
Message-ID: <4F390FAC.7090102@treenet.co.nz>
Date: Tue, 14 Feb 2012 02:27:08 +1300
From: Amos Jeffries <squid3@treenet.co.nz>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0) Gecko/20120129 Thunderbird/10.0
MIME-Version: 1.0
To: ietf-http-wg@w3.org
References: <8EDFE9E9-97FB-41C0-AE6F-E0D6ABA58413@mnot.net>
In-Reply-To: <8EDFE9E9-97FB-41C0-AE6F-E0D6ABA58413@mnot.net>
Content-Type: text/plain; charset="ISO-8859-1"; format="flowed"
Content-Transfer-Encoding: 7bit
Received-SPF: pass client-ip=58.28.153.233; envelope-from=squid3@treenet.co.nz; helo=treenet.co.nz
X-W3C-Hub-Spam-Status: No, score=-1.9
X-W3C-Hub-Spam-Report: BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001
X-W3C-Scan-Sig: maggie.w3.org 1RwvwN-0005Eh-30 51d1e19a1a3abd3497aa67d206975763
X-Original-To: ietf-http-wg@w3.org
Subject: Re: #337: Field names in cache-control header arguments
Archived-At: <http://www.w3.org/mid/4F390FAC.7090102@treenet.co.nz>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/12431
X-Loop: ietf-http-wg@w3.org
Resent-Sender: ietf-http-wg-request@w3.org
Precedence: list
List-Id: <ietf-http-wg.w3.org>
List-Help: <http://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>
Resent-Message-Id: <E1Rwvwf-0001ud-Om@frink.w3.org>
Resent-Date: Mon, 13 Feb 2012 13:27:53 +0000

On 13/02/2012 5:56 p.m., Mark Nottingham wrote:
> <http://trac.tools.ietf.org/wg/httpbis/trac/ticket/337>
>
>> The discussion of optional field-names in "private" and "no-cache" is vague about whether the cache MAY or MUST revalidate when handling a subsequent request for that resource. That is, if another request for the resource comes in, and the cached response is still fresh, is the cache allowed to return it, minus the forbidden headers, or is it required to revalidate, and merge in new values of those headers from the 304 response?)
> See<http://tools.ietf.org/html/draft-ietf-httpbis-p6-cache-18#section-3.2.2>  for the relevant text.
>
>
> I had a look at this. I think we can fix things for private -- proposal is to change:
>
> ... That is, a shared cache MUST NOT store the specified field-names(s), whereas it MAY store the remainder of the response message.
>
> to
>
> ... That is, a shared cache MUST NOT store the specified field-names(s), whereas it MAY store the remainder of the response message (and subsequently reuse it).

Its a hard sentance to phrase well. This new version still misses out 
mention of revalidation.

Perhapse a mention of whether it should erase the "private" control as 
well as the listed fields when storing and before re-use? That should 
make it a little clearer.

Perhapse something like:
"

That is, a shared cache MAY store and subsequently reuse the response, but MUST strip the specified field-names(s) and the private control before storing it.

"

NP: I include the private="..." control in the removal to help older 
caches see that the sanitized version of the response is cacheable. That 
is one useful detail which has been omitted entirely.


>
>
> However, the semantics of these arguments on no-cache is much less clear. IME this isn't implemented, so I'd suggest deprecating it by changing:
>
>        If the no-cache response directive specifies one or more field-
>        names, this requirement is limited to the field-values associated
>        with the listed response header fields.  That is, a cache MUST NOT
>        send the specified field-name(s) in the response to a subsequent
>        request without successful validation on the origin server.  This
>        allows an origin server to prevent the re-use of certain header
>        fields in a response, while still allowing caching of the rest of
>        the response.
>
>        Note: Most HTTP/1.0 caches will not recognize or obey this
>        directive.  Also, no-cache response directives with field-names
>        are often handled by implementations as if an unqualified no-cache
>        directive was received; i.e., the special handling for the
>        qualified form is not widely implemented.
>
>
> To:
>
> """
> The no-cache response directive was originally defined to allow specification of one or more field-names as a parameter value. However, this form is not widely implemented, and their semantics are not well-defined; as a result, this form is deprecated, and servers SHOULD NOT send them. Caches are advised to silently ignore these parameters and treat the response as if it had contained a bare no-cache directive.
> """
>
> Comments? I'm not against also deprecating them in this fashion on private, if there's support for that.

I have seen some apps try to use them before they ran up against Squids 
lack of implementation. It did seem useful for them to specify some 
headers (ie Cookie or a custom equivalent) that if present needed 
revalidation, or if that failed the response was perfectly usable stale 
(or not even stale yet) without the header.

So,  IMO keep it as an option and we can implement, the Squid reasons 
for no implementation is simply we have not got that far through RFC 
2616 yet.

What I don't get is the nasty overlap between no-cache and 
must-revalidate. Why no-cache with field names is equivalent to 
must-revalidate for those fields, but must-revalidate has no field-names 
list at all.

It would seem common sense for clarity to deprecate no-cache entirely 
for senders and move the field list to must-revalidate. The result is 
self-explanatory, (but does sadly consume a few more bytes).

AYJ