Re: A fresh stale response

Mark Nottingham <mnot@mnot.net> Tue, 09 October 2018 04:36 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 3FC371310E2 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 8 Oct 2018 21:36:48 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.75
X-Spam-Level:
X-Spam-Status: No, score=-2.75 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, MAILING_LIST_MULTI=-1, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=mnot.net header.b=MAnrCfx4; dkim=pass (2048-bit key) header.d=messagingengine.com header.b=P0MYT+UK
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 U-6lLNkhBGdv for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 8 Oct 2018 21:36:46 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [IPv6:2603:400a:ffff:804:801e:34:0:38]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 01F5813101B for <httpbisa-archive-bis2Juki@lists.ietf.org>; Mon, 8 Oct 2018 21:36:45 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.89) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1g9jhv-0002ci-IE for ietf-http-wg-dist@listhub.w3.org; Tue, 09 Oct 2018 04:33:19 +0000
Resent-Date: Tue, 09 Oct 2018 04:33:19 +0000
Resent-Message-Id: <E1g9jhv-0002ci-IE@frink.w3.org>
Received: from titan.w3.org ([2603:400a:ffff:804:801e:34:0:4c]) by frink.w3.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from <mnot@mnot.net>) id 1g9jhu-0002c5-Cw for ietf-http-wg@listhub.w3.org; Tue, 09 Oct 2018 04:33:18 +0000
Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by titan.w3.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from <mnot@mnot.net>) id 1g9jhr-00082C-Ur for ietf-http-wg@w3.org; Tue, 09 Oct 2018 04:33:18 +0000
Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id DE13593B; Tue, 9 Oct 2018 00:32:53 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Tue, 09 Oct 2018 00:32:54 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mnot.net; h= content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=fm3; bh=4 WJJovxB8ojHc6F5KFF32aeAxmI2YrrwIx3pw16+a7Y=; b=MAnrCfx4aCsAVkNv9 4gly9javmYrHSeIrqeHcTcfnTUAIP/PoKUoEWftDz6axLMhxj0RqxQlSkt4QQoFo JZyDPO6dU+5YPVpr6+4HvRJadWUFH2WKpTwjZokBz4LAiBGCao2/VVQg/DDJ/srI vZV+HtJE3ZKHlwEjUcdZRGpiUWaqEYgQ28PZoRNZxXU4CVJkl5nhjBegWJgPwPmQ B5xxGoifewF9vZrTnwA4WlLLtcRGHgOFtAbXOUiDQtluCxZ6gWkwyq5mzORXQrPA qc8AdH0DDKyD3Po8kyDdCI6YnAiitZv+4+4snAHKf6ZAZY2S1jTQDltgEJaGwYQB 50GAA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=4WJJovxB8ojHc6F5KFF32aeAxmI2YrrwIx3pw16+a 7Y=; b=P0MYT+UKlAjrvfuOYBmhnf9NVr2tCRnsdtMqbTs6KjPGtYXHh71whgqvB htpE1vGZoNJRuR5PwVCuXXNwLZnqskbfTa/QSnhPq7cWei+pz8v2en/E6ttz22kx 6H9YB5ROeLiPcHxIs/fCGTGL8hte+0SbNBqmxk3qsHvx/Yt6Dn2m/wWM/CyEQr3+ X2zKx3GQoQUt5dGFiw6thUVgyk4cU1I080tHOY4WazPcFVWqWZxTF6o4osqlZkUm pshOryF68AmiQMq6Aq5d22aPx/v/qo7QhQqioG26SUke/BL3YC9nsbleUSf2l2F6 Qw9P2B9TZ2mW3vJqecBUSXT+yuPcw==
X-ME-Sender: <xms:cy-8W2qiENZPQLUdx6e1MMmUftQ9asRe9UObSbwtZgxUfJ7wi_-SrQ>
X-ME-Proxy: <xmx:cy-8W20GGIVeRzgQgsUNH-JuEK7fVtpKmxnBuy_0yKuxa94fSad_sg> <xmx:cy-8W-Oe2806b5wdyIT48yYWbW0Nxd00YcbHTuxDrYpott6Zq2a0IQ> <xmx:cy-8Wx1wWMcC8kGX_AxPbHENEGgZJgmq8JL0Swrx1XqBcaNdvk4PCA> <xmx:cy-8W90Sagmy0ueKUVMyQ-_k9XVG9yYLirt--ThJXMrGXfyla46NhQ> <xmx:cy-8W__k2zSj4SQ4BZUTHlHQOhXSZE-CJ9ifOfhcwUkJq4VnhzyliA> <xmx:dS-8W7MOTZ0foqu8aXiVVY1K48XNYmp8DyugO7dQRjdmfQDGUd1Fkg>
Received: from attitudadjuster.mnot.net (unknown [144.136.175.28]) by mail.messagingengine.com (Postfix) with ESMTPA id C7D34E4307; Tue, 9 Oct 2018 00:32:50 -0400 (EDT)
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0 (Mac OS X Mail 12.0 \(3445.100.39\))
From: Mark Nottingham <mnot@mnot.net>
In-Reply-To: <57351E03.1090103@measurement-factory.com>
Date: Tue, 09 Oct 2018 15:32:47 +1100
Cc: HTTP Working Group <ietf-http-wg@w3.org>
Content-Transfer-Encoding: quoted-printable
Message-Id: <E937A2D6-20FF-4F2A-A1A6-E2AF3139DB16@mnot.net>
References: <57351E03.1090103@measurement-factory.com>
To: Alex Rousskov <rousskov@measurement-factory.com>
X-Mailer: Apple Mail (2.3445.100.39)
X-W3C-Hub-Spam-Status: No, score=-6.7
X-W3C-Hub-Spam-Report: AWL=3.016, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, W3C_AA=-1, W3C_DB=-1, W3C_IRA=-1, W3C_IRR=-3, W3C_WL=-1
X-W3C-Scan-Sig: titan.w3.org 1g9jhr-00082C-Ur 59a51acf10b09f676b4cea56aebf2920
X-Original-To: ietf-http-wg@w3.org
Subject: Re: A fresh stale response
Archived-At: <https://www.w3.org/mid/E937A2D6-20FF-4F2A-A1A6-E2AF3139DB16@mnot.net>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/35949
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: <https://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

Hi Alex,

This is now <https://github.com/httpwg/http-core/issues/23>. 

I've put some thoughts down there.

Cheers,


> On 13 May 2016, at 10:21 am, Alex Rousskov <rousskov@measurement-factory.com> wrote:
> 
> Hello,
> 
>    I need help navigating a pair of semi-conflicting RFC 7234 MUSTs.
> 
> Imagine a cache that has a stored response A with a Date value X. The
> cache sends a conditional request to validate that cached response. The
> cache receives a 200 OK response B with a Date value of Y.
> 
> If X <= Y, then the situation is clear -- A is stale and the cache
> should use B.
> 
> What if X > Y? In other words, what if the cache receives a 200 OK
> response B that appears to be older (i.e., even more stale) than the
> response A the cache is trying to validate? Should the cache trust the
> sender's staleness decision or its own date comparison logic?
> 
> * RFC 7234 section 4 says "a cache MUST use the most recent response (as
> determined by the Date header field)". That means A wins.
> 
> * RFC 7234 section 4.3.3 says "the cache MUST use the full response [it
> just received]". That means B wins.
> 
> * RFC 2616 section 13.2.5 says "If a client performing a retrieval
> receives a non-first-hand response for a request that was already fresh
> in its own cache, and the Date header in its existing cache entry is
> newer than the Date on the new response, then the client MAY ignore the
> response". That means A wins if A was fresh and B came from a cache.
> 
> 
> If I have to guess, I would use B if it does not have an Age header,
> boldly assuming that it is a first-hand response. Otherwise, use A. With
> more time/effort, revalidating with max-age=0 would be a good option
> (but it may result in the same conundrum).
> 
> 
> Is this a gray area, or did I miss a specific HTTPbis rule that resolves
> this conflict? Was the quoted RFC 2616 MAY replaced with something
> equally specific? If this is a gray area, what do you recommend?
> 
> 
> Thank you,
> 
> Alex.
> 

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