Re: Collapsed requests and response freshness checks

Mark Nottingham <mnot@mnot.net> Sat, 17 February 2024 22:38 UTC

Return-Path: <ietf-http-wg-request+bounce-httpbisa-archive-bis2juki=ietf.org@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 499D6C14F5F1 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sat, 17 Feb 2024 14:38:51 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.857
X-Spam-Level:
X-Spam-Status: No, score=-2.857 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_DBL_BLOCKED_OPENDNS=0.001, URIBL_ZEN_BLOCKED_OPENDNS=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=w3.org header.b="n1Hqr7Ag"; dkim=pass (2048-bit key) header.d=w3.org header.b="IFPjOdCr"; dkim=pass (2048-bit key) header.d=mnot.net header.b="Uiwld2Dg"; dkim=pass (2048-bit key) header.d=messagingengine.com header.b="p25sHVxd"
Received: from mail.ietf.org ([50.223.129.194]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id BnZ2fE4YJams for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sat, 17 Feb 2024 14:38:46 -0800 (PST)
Received: from lyra.w3.org (lyra.w3.org [128.30.52.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 61AF5C14F5E9 for <httpbisa-archive-bis2Juki@ietf.org>; Sat, 17 Feb 2024 14:38:46 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=w3.org; s=s1; h=Subject:To:References:Message-Id:Cc:Date:In-Reply-To:From: Mime-Version:Content-Type:Reply-To; bh=VZ7oNPV8HoTqwzLvtqBrw1IBIBb9oNCD5dCtOY6NliE=; b=n1Hqr7AgvgD3Mm3gN6fQMgoMSj gEZub0G8NT50DjcjnOpC1nQhNLS1AFlEqVMIsAWlotKlNrR/oAUXtzDFWgyvs5IJP4H1VzYghUf1W pF1saFDN7ZIaj5MLAwBTsseIL4qn379+bAJqacosIq1uOszQ3HL5eP56BuoI5mnHphYIrFOYzFmpc ARSQBQfEdUBgjljPw6JDKqCDOQVYYg4ywv964nTSxHBI5+v8ndHuv7h1ot4pvCLBEhw0+4wMFfvSN LHUmqq4UsE7ua0++vdRgPqeXOLx8b9GCuIR2jfzrI/vDZkm7Zixe9fTCmG2q5924LPl2D4FGcU5p5 YizPucEA==;
Received: from lists by lyra.w3.org with local (Exim 4.94.2) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1rbTKG-00DTEq-GC for ietf-http-wg-dist@listhub.w3.org; Sat, 17 Feb 2024 22:38:28 +0000
Resent-Date: Sat, 17 Feb 2024 22:38:28 +0000
Resent-Message-Id: <E1rbTKG-00DTEq-GC@lyra.w3.org>
Received: from puck.w3.org ([34.196.82.207]) by lyra.w3.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from <mnot@mnot.net>) id 1rbTKE-00DTDH-J7 for ietf-http-wg@listhub.w3.org; Sat, 17 Feb 2024 22:38:26 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=w3.org; s=s1; h=To:References:Message-Id:Cc:Date:In-Reply-To:From:Subject: Mime-Version:Content-Type:Reply-To; bh=VZ7oNPV8HoTqwzLvtqBrw1IBIBb9oNCD5dCtOY6NliE=; t=1708209506; x=1709073506; b=IFPjOdCrAAcDUuLu+iYMn/bAUJwICaXignslvBWwlAwtLg0KBPM3kegbRsh22q1brJ1gpM2O7+c 7wSNFSioGjqbupvTG368julV6p81MBTlLrV5FvDr0ly3PBNS8iH0c7qZ4Hy8yGa64KKRIkJablhSo cNANoglq60HvtfklCpfwPus4O3J5tKUiiQEfLsdg83YRS4r5jI+kmrFyRlD9dxwQzBQV16CKqAmxc pSbsV37kVhW15KmPlQ7X0O00+dHnzxABljuCw3TjOQQL+9SOFURnbgEvDrsNMN1wsvj5S+t2WmTFF 6nEeHvN6WtgIFRVcSWOTMYwzlempGJJ23KIA==;
Received-SPF: pass (puck.w3.org: domain of mnot.net designates 64.147.123.25 as permitted sender) client-ip=64.147.123.25; envelope-from=mnot@mnot.net; helo=wout2-smtp.messagingengine.com;
Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by puck.w3.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from <mnot@mnot.net>) id 1rbTKD-000rvR-1w for ietf-http-wg@w3.org; Sat, 17 Feb 2024 22:38:26 +0000
Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 57746320034E; Sat, 17 Feb 2024 17:38:21 -0500 (EST)
Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sat, 17 Feb 2024 17:38:21 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mnot.net; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1708209500; x=1708295900; bh=VZ7oNPV8HoTqwzLvtqBrw1IBIBb9oNCD5dCtOY6NliE=; b= Uiwld2DgWlgim+m9GHXzI0iaOcYv/AjIy/turatYghJV4MkEeikSPHfp3iTWefz4 MGOL5JjVn4YzMcncQNs/gQBDfeyTyxyFvS/MDNKl/hFQmg17k9wQa3Rf1OdPfFxF OhOTG0wnoiW73kUWqdtkiX5v31DMhMFwppoAFt7rpBjZmCeGnkXM/ZYaSx/dy6Ci pGGq8+b/5xbmUs8ht/tSIJyIsHVp14q9/pJDpJ0X04e43kmTc5K0QM7sSv7GQxYo 1W74f0vuQ7/0oYQKlOAzQoXEXR3+wuUQtLL3K1LyiG5YBBDMaWPcL7XK6MYD41xp nlGCCM+emxVO8OGYMZ0tVQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1708209500; x= 1708295900; bh=VZ7oNPV8HoTqwzLvtqBrw1IBIBb9oNCD5dCtOY6NliE=; b=p 25sHVxdN2DZUiPFLB/TaLS95kVoEc84vTqM04D+tcCelxKU8HkuJw5LdvBE9aaZ+ 5Hffj7ahMI/E2X7hBesDgOhh+z367E4GX78iMECuJKwnkjUe2LTLMEUs+JFXI2sA BZ4TkPw2WpuyasOLJaIAAUMwiwe4UDKxwFVDVl0cOfE7Mx/7LDBSDG7FavXPtegG QUMk6y0nYqpd6vSdaV5IrNaHfHpXGW7ta/PymuBwKyGrzprlFNqLDR9gI96ImHjh IVuoyQqfH0W/PZxMRUOogk2bz/e9u5BI49b755as4m/p2D2kPQt43Ldq5F6MMfAA YNtoE/7zbv6CpNS21jriQ==
X-ME-Sender: <xms:XDXRZbODinCyrbMCvP8asDmEI_NXDP4fXAplIXTpdTd5kVwFtubRHA> <xme:XDXRZV8BR0gqCgEb9rYR7dgrqKVwi-0Lz7IzhRIqeENCgrTRxdQRrBOc9tr-UF8mr CoVqZsPNFa0azORWg>
X-ME-Received: <xmr:XDXRZaRHay4JtOdVEBP65o9Ag3doqssJOXs4tlB-B9buAqD5-iNUl6n31LtG8EHHEotR4pvhoiJBzrc66OoQg8OjIrc8V2nwj6MS88lVmgU_wOv5Xs358dpY>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdehucetufdoteggodetrfdotffvucfrrh hofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgenuceurghi lhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurh eptggguffhjgffvefgkfhfvffosehtqhhmtdhhtddvnecuhfhrohhmpeforghrkhcupfho thhtihhnghhhrghmuceomhhnohhtsehmnhhothdrnhgvtheqnecuggftrfgrthhtvghrnh epueeuhfegueegieeghedufeelheehleejvdduhfefffelfeekkeektdeiudegffdunecu ffhomhgrihhnpehgihhthhhusgdrtghomhdprhhftgdqvgguihhtohhrrdhorhhgpdhmnh hothdrnhgvthenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhr ohhmpehmnhhothesmhhnohhtrdhnvght
X-ME-Proxy: <xmx:XDXRZftEHq5ADvDkAdZFKiMRiuXZXQPfKT8MpJc9P-R-_x0ZHRgWew> <xmx:XDXRZTelhNJ7lfOkPWModbpwEWw05Y_EGIDwdTvN4cdsjtEuUf2b5w> <xmx:XDXRZb1ehFDgIoMaK9sZ4xuM8ERBmY_3k0tPU0cggpU-S2fXPpduKQ> <xmx:XDXRZbHUXDeal6GKeOxiijoKJKNj6Ueg0ppnGtXvy1KO4K-r0fW2yg>
Feedback-ID: ie6694242:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 17 Feb 2024 17:38:19 -0500 (EST)
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.300.61.1.2\))
From: Mark Nottingham <mnot@mnot.net>
In-Reply-To: <89474d6f-4a47-4368-ad5d-e671499ba05f@measurement-factory.com>
Date: Sun, 18 Feb 2024 09:38:14 +1100
Cc: HTTP Working Group <ietf-http-wg@w3.org>
Content-Transfer-Encoding: quoted-printable
Message-Id: <323B7C7C-1BEA-4ED7-B102-97650DB8176C@mnot.net>
References: <89474d6f-4a47-4368-ad5d-e671499ba05f@measurement-factory.com>
To: Alex Rousskov <rousskov@measurement-factory.com>
X-Mailer: Apple Mail (2.3774.300.61.1.2)
X-W3C-Hub-DKIM-Status: validation passed: (address=mnot@mnot.net domain=mnot.net), signature is good
X-W3C-Hub-DKIM-Status: validation passed: (address=mnot@mnot.net domain=messagingengine.com), signature is good
X-W3C-Hub-Spam-Status: No, score=-14.1
X-W3C-Hub-Spam-Report: BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, DMARC_PASS=-0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_DBL_BLOCKED_OPENDNS=0.001, W3C_AA=-1, W3C_DB=-1, W3C_IRA=-1, W3C_IRR=-3, W3C_WL=-1
X-W3C-Scan-Sig: puck.w3.org 1rbTKD-000rvR-1w ce2973ebe1aab1bd2d20870f0a73ad61
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Collapsed requests and response freshness checks
Archived-At: <https://www.w3.org/mid/323B7C7C-1BEA-4ED7-B102-97650DB8176C@mnot.net>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/51796
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/email/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

Hi Alex,

I'd answer 'yes' and 'yes' -- unless there's something in the response that makes it ineligible for use with a particular request, there's no reason to think that the server will respond any differently to a subsequent retry of that request. In this view, the response is treated as if it's a response to each individual request, rather than being something that has already been stored by a cache.

I agree that it's not clear in the spec; the text on collapsed forwarding is new in 9111, and we didn't go into great detail. One of the things we factored out of 2616 was the concept of 'first-hand' - it might be useful again here.

I already have an issue[1] open to probe the edges of collapsed forwarding for cache-tests.fyi; I'll try to explore these aspects too when I get to it.

Cheers, 



1. https://github.com/http-tests/cache-tests/issues/129



> On 18 Feb 2024, at 09:02, Alex Rousskov <rousskov@measurement-factory.com> wrote:
> 
> Hello,
> 
>    RFC 9111 Section 4[1] says "cache can use a response that is stored or storable to satisfy multiple requests, provided that it is allowed to reuse that response for the requests in question". I am trying to understand which rules allow or prohibit that reuse. My guess is that _all_ "MUST not reuse a stored response unless..." rules in that Section apply, but since the response to the collapsed request is not necessarily a "stored response" (i.e. it could be "storable"), I want to double check.
> 
> For example, can a cache reuse a stale-on-arrival response to satisfy a collapsed request (without doing revalidation)? Let's assume the response in question is not "allowed to be served stale". Informally, the response in question is nearly as fresh as they get because it is being received to satisfy a _concurrent_ request (that our request has collapsed on). However, formal freshness rules may still require treating this response as stale (e.g., max-age=0), either in general (i.e. for any request) or with respect to our collapsed request.
> 
> Similarly, can a cache reuse a stale-on-arrival response with a must-revalidate directive to satisfy a collapsed request (without doing revalidation)? Here, the wiggle room for reuse appears to be even smaller because a cache "MUST NOT reuse that response to satisfy another request until it has been successfully validated by the origin".
> 
> I suspect the answers are "no" and "no", and, more generally speaking, there are just no reuse exceptions for collapsed requests compared to regular cache hits -- a cache has to treat the incoming response as if it was a previously stored cache hit, even though the response may still be coming into the cache (as the result of the original request that our request has collapsed on). In other words, all Section 4 reuse rules[1] apply. I would appreciate a confirmation.
> 
> 
> Thank you,
> 
> Alex.
> 
> [1]: https://www.rfc-editor.org/rfc/rfc9111.html#name-constructing-responses-from
> 

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