Re: 304 on Non-Conditional Request?

Mark Nottingham <mnot@mnot.net> Fri, 12 August 2016 00:54 UTC

Return-Path: <ietf-http-wg-request+bounce-httpbisa-archive-bis2juki=lists.ie@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 5040212D897 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Thu, 11 Aug 2016 17:54:48 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -8.168
X-Spam-Level:
X-Spam-Status: No, score=-8.168 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.247, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id O3Ar0md2broI for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Thu, 11 Aug 2016 17:54:46 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D09E112D7F7 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Thu, 11 Aug 2016 17:54:46 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1bY0gL-0001RQ-FW for ietf-http-wg-dist@listhub.w3.org; Fri, 12 Aug 2016 00:50:41 +0000
Resent-Date: Fri, 12 Aug 2016 00:50:41 +0000
Resent-Message-Id: <E1bY0gL-0001RQ-FW@frink.w3.org>
Received: from lisa.w3.org ([128.30.52.41]) by frink.w3.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <mnot@mnot.net>) id 1bY0gB-0001Q0-Ph for ietf-http-wg@listhub.w3.org; Fri, 12 Aug 2016 00:50:31 +0000
Received: from mxout-07.mxes.net ([216.86.168.182]) by lisa.w3.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from <mnot@mnot.net>) id 1bY0gA-0004VQ-2V for ietf-http-wg@w3.org; Fri, 12 Aug 2016 00:50:31 +0000
Received: from [192.168.1.101] (unknown [124.189.98.244]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTPSA id AF48C22E259; Thu, 11 Aug 2016 20:50:05 -0400 (EDT)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\))
From: Mark Nottingham <mnot@mnot.net>
In-Reply-To: <BY1PR03MB1338D4919BC6CB061EF86C5E871E0@BY1PR03MB1338.namprd03.prod.outlook.com>
Date: Fri, 12 Aug 2016 10:50:03 +1000
Cc: HTTP Working Group <ietf-http-wg@w3.org>
Content-Transfer-Encoding: quoted-printable
Message-Id: <0729AF09-3345-4C1B-96C6-FDB881353827@mnot.net>
References: <BY1PR03MB1338D4919BC6CB061EF86C5E871E0@BY1PR03MB1338.namprd03.prod.outlook.com>
To: Mike Bishop <Michael.Bishop@microsoft.com>
X-Mailer: Apple Mail (2.3124)
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=-8.5
X-W3C-Hub-Spam-Report: AWL=1.081, BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, W3C_AA=-1, W3C_DB=-1, W3C_IRA=-1, W3C_IRR=-3, W3C_WL=-1
X-W3C-Scan-Sig: lisa.w3.org 1bY0gA-0004VQ-2V 481ee9aba65d7f61d09299b4a7fd33d4
X-Original-To: ietf-http-wg@w3.org
Subject: Re: 304 on Non-Conditional Request?
Archived-At: <http://www.w3.org/mid/0729AF09-3345-4C1B-96C6-FDB881353827@mnot.net>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/32259
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>

If you squint at it just right, you can see a 304 as a redirect to what you already have at hand -- in the common case, what you have in cache, expressed by the conditional.

If there were some other way of expressing what you have at hand, a 304 might be the status code to return in that situation too. It would require some work, though.

Cheers,


> On 12 Aug 2016, at 7:44 AM, Mike Bishop <Michael.Bishop@microsoft.com> wrote:
> 
> Going back over my HTTP Workshop notes around push and cache revalidation, I see a comment that a 304 response to a non-conditional GET is supposed to be valid, if somewhat ambiguous.  I’m trying to parse what that would mean, and I’m drawing a blank.
>  
> RFC 7232 defines 304 (Not Modified) this way:
>    The 304 (Not Modified) status code indicates that a conditional GET
>    or HEAD request has been received and would have resulted in a 200
>    (OK) response if it were not for the fact that the condition
>    evaluated to false.  In other words, there is no need for the server
>    to transfer a representation of the target resource because the
>    request indicates that the client, which made the request
>    conditional, already has a valid representation; the server is
>    therefore redirecting the client to make use of that stored
>    representation as if it were the payload of a 200 (OK) response.
>  
> I therefore can’t envision the scenario in which you would use this for a non-conditional GET.  I could vaguely see the reason phrase “Not Modified” as applying to e.g. a PATCH or PUT that doesn’t actually result in a change to the resource, but that still seems more like a 2XX series response, perhaps 202 (Accepted).  But that’s not GET.
>  
> Is there a scenario I’m missing, were my notes incorrect, or did I accurately transcribe the comment of someone who was incorrect?

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