Collapsed requests and response freshness checks

Alex Rousskov <rousskov@measurement-factory.com> Sat, 17 February 2024 22:05 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 42AD8C14F5EF for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sat, 17 Feb 2024 14:05:20 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.756
X-Spam-Level:
X-Spam-Status: No, score=-2.756 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-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_BLOCKED=0.001, 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="KkBqjXZP"; dkim=pass (2048-bit key) header.d=w3.org header.b="g3gabm+7"
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 YNPFEyNPEbCs for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sat, 17 Feb 2024 14:05:16 -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 93228C14EB19 for <httpbisa-archive-bis2Juki@ietf.org>; Sat, 17 Feb 2024 14:05:16 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=w3.org; s=s1; h=Subject:Content-Type:To:From:MIME-Version:Date:Message-ID:Cc:Reply-To :In-Reply-To:References; bh=aFDqPJ2v37wMgv4tOhnkI6gNaAccFCmijRIowYyVo/o=; b=K kBqjXZPcEZxtrtwOH8XGLlDKHKdDeGNlgVg4k9HjWpMuPVW7vEzVBOv4J33lwRQXv0rocC+mTkyUI U6wU3RR9rcsKURN7yno/DbpjXvFvX/irCYXNd4zepE7YWlGbweilVwY2rKeRG6Eysw5vlvVyCdZpb mUZTaNV9btfAogdcnt9yxtNSoZBMCwPc+ufhG5aOoT8z5x2YqQRztH2XxP7w4ejLZW2PYsPRcsXm8 5UWUJJRioAbHqfrusvzXNRz/wWVWoLbBxN/WX5qheaIsa01zwDneUXTTtiFl91YInT3CJh6eLh3eo kk82QLvyMlU3VS60cVveEf9Xux57az2OA==;
Received: from lists by lyra.w3.org with local (Exim 4.94.2) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1rbSlo-00DPOV-CA for ietf-http-wg-dist@listhub.w3.org; Sat, 17 Feb 2024 22:02:52 +0000
Resent-Date: Sat, 17 Feb 2024 22:02:52 +0000
Resent-Message-Id: <E1rbSlo-00DPOV-CA@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 <rousskov@measurement-factory.com>) id 1rbSll-00DPNP-VG for ietf-http-wg@listhub.w3.org; Sat, 17 Feb 2024 22:02:49 +0000
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=w3.org; s=s1; h=Content-Type:To:Subject:From:MIME-Version:Date:Message-ID:Cc:Reply-To :In-Reply-To:References; bh=aFDqPJ2v37wMgv4tOhnkI6gNaAccFCmijRIowYyVo/o=; t=1708207369; x=1709071369; b=g3gabm+7w8pT6JGQTxBO0pFD2U8r8BvoyPe8UIFp84d47+X VsDLEfFnyzB9w3G7oYZ3mcdjVnCsqTVVu95Vu/w5BflLhNaeryiMvrD9Wut4V4lxoewJVEeXkvS0b pGXZ+lpoYBOzVbKsX9URwZlBKZgJs3iSvXdrJeaq1W9oMP09EQffmXAwnAafccBbHFetrZhmrp3Br Bjz2Bmon4fsw7NxvDDKvRVhQKKb/19fuqWOSc6Z5fYRlBb+lSbJiiEDtKKivvIeKbe91PXWOfhAgb sQsU/vYzVTiWHkJCkb3oB88cCrIW90YI9ekaXIHaX7gNOJeR9h3rIRy5BKK0fe/g==;
Received-SPF: pass (puck.w3.org: domain of measurement-factory.com designates 104.237.131.42 as permitted sender) client-ip=104.237.131.42; envelope-from=rousskov@measurement-factory.com; helo=mail.measurement-factory.com;
Received: from measurement-factory.com ([104.237.131.42] helo=mail.measurement-factory.com) by puck.w3.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from <rousskov@measurement-factory.com>) id 1rbSlk-000rYk-2V for ietf-http-wg@w3.org; Sat, 17 Feb 2024 22:02:49 +0000
Received: from [192.168.1.74] (unknown [199.185.175.160]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.measurement-factory.com (Postfix) with ESMTPSA id 97559E03D for <ietf-http-wg@w3.org>; Sat, 17 Feb 2024 22:02:44 +0000 (UTC)
Message-ID: <89474d6f-4a47-4368-ad5d-e671499ba05f@measurement-factory.com>
Date: Sat, 17 Feb 2024 17:02:43 -0500
MIME-Version: 1.0
User-Agent: Mozilla Thunderbird
Content-Language: en-US
From: Alex Rousskov <rousskov@measurement-factory.com>
To: HTTP Working Group <ietf-http-wg@w3.org>
Content-Type: text/plain; charset="UTF-8"; format="flowed"
Content-Transfer-Encoding: 7bit
X-W3C-Hub-Spam-Status: No, score=-8.9
X-W3C-Hub-Spam-Report: BAYES_00=-1.9, DMARC_MISSING=0.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_ZEN_BLOCKED_OPENDNS=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_DBL_BLOCKED_OPENDNS=0.001, W3C_AA=-1, W3C_WL=-1
X-W3C-Scan-Sig: puck.w3.org 1rbSlk-000rYk-2V 6674a2cfcb214db0f9dd4dd93966fc34
X-Original-To: ietf-http-wg@w3.org
Subject: Collapsed requests and response freshness checks
Archived-At: <https://www.w3.org/mid/89474d6f-4a47-4368-ad5d-e671499ba05f@measurement-factory.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/51795
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>

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