Re: WGLC #354 - ETags & conditional requests

Mark Nottingham <mnot@mnot.net> Wed, 27 June 2012 02:07 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 B2C2811E80FD for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 26 Jun 2012 19:07:22 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -10.159
X-Spam-Level:
X-Spam-Status: No, score=-10.159 tagged_above=-999 required=5 tests=[AWL=0.440, 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 0QZJpMLJbI3a for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 26 Jun 2012 19:07:21 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) by ietfa.amsl.com (Postfix) with ESMTP id ADA2611E80EF for <httpbisa-archive-bis2Juki@lists.ietf.org>; Tue, 26 Jun 2012 19:07:21 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.69) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1SjhcV-0000Us-6s for ietf-http-wg-dist@listhub.w3.org; Wed, 27 Jun 2012 02:04:39 +0000
Received: from maggie.w3.org ([128.30.52.39]) by frink.w3.org with esmtp (Exim 4.69) (envelope-from <mnot@mnot.net>) id 1SjhcC-0000Ty-K1 for ietf-http-wg@listhub.w3.org; Wed, 27 Jun 2012 02:04:20 +0000
Received: from mxout-07.mxes.net ([216.86.168.182]) by maggie.w3.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from <mnot@mnot.net>) id 1Sjhc9-0004aT-AM for ietf-http-wg@w3.org; Wed, 27 Jun 2012 02:04:18 +0000
Received: from mnot-mini.mnot.net (unknown [118.209.196.77]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTPSA id 24FEA22DD6D for <ietf-http-wg@w3.org>; Tue, 26 Jun 2012 22:03:54 -0400 (EDT)
Content-Type: text/plain; charset="iso-8859-1"
Mime-Version: 1.0 (Apple Message framework v1278)
From: Mark Nottingham <mnot@mnot.net>
In-Reply-To: <4FE45AD8.3080801@velocix.com>
Date: Wed, 27 Jun 2012 12:03:51 +1000
Content-Transfer-Encoding: quoted-printable
Message-Id: <F2B07AA1-9D24-4BF8-BDC0-50A16942322B@mnot.net>
References: <B5E63193-2450-41AD-A3AA-047755F2189D@niven-jenkins.co.uk> <6B348243-BC1C-48C0-822A-1649FDAF7091@mnot.net> <F65ED7E8-7B71-4DFC-98BC-51FCC1B4936B@mnot.net> <CACuKZqHdp2_sL=V9pg1cnTrYOwWjAzh4+d-wh+qpnFRzONyQ-g@mail.gmail.com> <4DEBDF43-17B3-4EA7-A014-46932F037CCA@mnot.net> <4FE45AD8.3080801@velocix.com>
To: HTTP Working Group <ietf-http-wg@w3.org>
X-Mailer: Apple Mail (2.1278)
Received-SPF: pass client-ip=216.86.168.182; envelope-from=mnot@mnot.net; helo=mxout-07.mxes.net
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 1Sjhc9-0004aT-AM 0c89ae5a1b6d3d7ddd2ba8b74c76e33a
X-Original-To: ietf-http-wg@w3.org
Subject: Re: WGLC #354 - ETags & conditional requests
Archived-At: <http://www.w3.org/mid/F2B07AA1-9D24-4BF8-BDC0-50A16942322B@mnot.net>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/13941
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: <E1SjhcV-0000Us-6s@frink.w3.org>
Resent-Date: Wed, 27 Jun 2012 02:04:39 +0000

Haven't heard any objection, so I've assigned for incorporation in -20.


On 22/06/2012, at 9:45 PM, John Sullivan wrote:

> Mark Nottingham wrote:
>> Of course, thanks; I always forget about the Range cases.
>> 
>> How about:
>> 
>> """
>> If any of the entity-tags listed in the If-Match field value match (as per Section 2.3.2) the entity-tag of the selected representation for the target resource, or if "*" is given and any current representation exists for the target resource, then the server may perform the request method as if the If-Match header field was not present.
>> 
>> Origin servers must not perform the requested method if none of the entity-tags match, or if "*" is given and no current representation exists; instead, they must respond with the 412 (Precondition Failed) status code.
>> 
>> Proxy servers using a cached response as the selected representation must not perform the requested method if none of the entity-tags match, or if "*" is given and no current representation exists; instead, they must forward the request towards the origin server.
>> """
> 
> That sounds good to me - just a minor question about the wording:
> 
>    If any of the entity-tags listed in the If-Match field value match
>    (as per Section 2.3.2) the entity-tag of the selected representation
>    for the target resource
> 
> That makes it sound like, in cases where the server has multiple
> representations available, it will first choose one, *then* compare
> with If-Match. (So if several equivalent versions are available and
> If-Match contains one ETag, and the server chooses the "wrong" one
> in step 1, it will always fail to match in step 2.) I just wondered
> whether the opposite way is specifically excluded: search the available
> versions for one matching an ETag present in If-Match, which will always
> succeed if a matching representation is present.
> 
> 
>> On 22/06/2012, at 1:43 AM, Zhong Yu wrote:
>> 
>>> A valid use case for GET + If-Match may be a range request.
>>> 
>>> If the intermediary has a cached representation with matching tag,
>>> which it has reason to believe would be the "selected representation"
>>> from the original server, the intermediary may safely do the shortcut.
>>> Otherwise the request has to be forwarded to the original server.
>>> 
>>> Zhong Yu
>>> 
>>> On Wed, Jun 20, 2012 at 10:47 PM, Mark Nottingham <mnot@mnot.net> wrote:
>>>> <http://trac.tools.ietf.org/wg/httpbis/trac/ticket/354>; related text is at <https://svn.tools.ietf.org/svn/wg/httpbis/draft-ietf-httpbis/latest/p4-conditional.html#header.if-match>
>>>> 
>>>> Usually, this isn't a problem, because If-Match is only used with methods that to be written through to the origin server. E.g., when you PUT or POST something.
>>>> 
>>>> However, we shouldn't count on that.
>>>> 
>>>> One way to address this would be to target the requirements at "origin server" rather than "server"; i.e. to say that we don't expect intermediaries to process If-Match.
>>>> 
>>>> Thoughts?
>>>> 
>>>> 
>>>> On 24/04/2012, at 3:47 AM, Ben Niven-Jenkins wrote:
>>>> 
>>>>> Hi,
>>>>> 
>>>>> Apologies that this mail misses the WG LC deadline, in Velocix we're reviewing all the HTTPBIS documents but we're a little behind, hence the late comments, sorry. (we're still reviewing so might have more comments as we work through the documents)
>>>>> 
>>>>> On page 14 of P4 it states:
>>>>> 
>>>>> If none of the entity-tags match, or if "*" is given and no current
>>>>> representation exists, the server MUST NOT perform the requested
>>>>> method.  Instead, the server MUST respond with the 412 (Precondition
>>>>> Failed) status code.
>>>>> 
>>>>> This appears to apply to intermediates, but If-Match has a problem
>>>>> here that If-Unmodified-Since does not. If a proxy has a cached
>>>>> entity which has a newer Last-Modified timestamp it *knows* that
>>>>> the conditional has failed and can generate the required
>>>>> 412 Precondition Failed response itself. Otherwise it can satisfy
>>>>> the request from cache. Or relay if there is no current cached
>>>>> version.
>>>>> 
>>>>> But because multiple responses with different ETags may exist then a cache receiving If-Match with one etag, when it has a different etag cached, can not know for sure that the request etag does not exist. If it were to respond with a 412 status it would effectively be preventing the use of that conditional.
>>>>> 
>>>>> It would appear that the only two options available to an intermediate are to satisfy the request in the case of a known match, and relay upstream in all other cases (which would be in conflict with the spec as quoted above).
>>>>> 
>>>>> Thanks
>>>>> Ben
>>>>> 
>>>>> 
>>>> 
>>>> --
>>>> Mark Nottingham   http://www.mnot.net/
>>>> 
>>>> 
>>>> 
>>>> 
>> 
>> --
>> Mark Nottingham   http://www.mnot.net/
>> 
>> 
>> 
>> 
>> 
> 
> 
> John
> -- 
> 

--
Mark Nottingham   http://www.mnot.net/