Prefer: return=representation and caching

Ken Murchison <murch@fastmail.com> Sun, 14 June 2020 17:10 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 253F63A0816 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sun, 14 Jun 2020 10:10:42 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.749
X-Spam-Level:
X-Spam-Status: No, score=-2.749 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.249, MAILING_LIST_MULTI=-1, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, 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=fastmail.com header.b=SWKipEWd; dkim=pass (2048-bit key) header.d=messagingengine.com header.b=fmTUp5EI
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 E8ZAEhQlIvOP for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sun, 14 Jun 2020 10:10:40 -0700 (PDT)
Received: from lyra.w3.org (lyra.w3.org [128.30.52.18]) (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 6D6DF3A0815 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Sun, 14 Jun 2020 10:10:40 -0700 (PDT)
Received: from lists by lyra.w3.org with local (Exim 4.92) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1jkW78-0001R0-Q0 for ietf-http-wg-dist@listhub.w3.org; Sun, 14 Jun 2020 17:08:10 +0000
Resent-Date: Sun, 14 Jun 2020 17:08:10 +0000
Resent-Message-Id: <E1jkW78-0001R0-Q0@lyra.w3.org>
Received: from mimas.w3.org ([128.30.52.79]) by lyra.w3.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <murch@fastmail.com>) id 1jkW77-0001QF-Kq for ietf-http-wg@listhub.w3.org; Sun, 14 Jun 2020 17:08:09 +0000
Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by mimas.w3.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <murch@fastmail.com>) id 1jkW76-0002dA-3A for ietf-http-wg@w3.org; Sun, 14 Jun 2020 17:08:09 +0000
Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 37D8E4ED for <ietf-http-wg@w3.org>; Sun, 14 Jun 2020 13:07:55 -0400 (EDT)
Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sun, 14 Jun 2020 13:07:55 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= to:from:subject:message-id:date:mime-version:content-type :content-transfer-encoding; s=fm3; bh=HIAiu+tWPpIY0T4sFfg7MiHX1o puY5f7NwRmKAg2keU=; b=SWKipEWd2f2X611+T+L7/YNGPlpxDq1gdU5xy4Agnl 92Tms4W1nAm7SGCyxOZTrRbNbkQ3l6JHH/zu7Xe3L0sAtIrMCV0LGoScnlYSfPfw QikaJH5aTlnOnYfk4owKWGNqKLFDTd/jGDXo/g4W198VpZ4Hx7MehzyfrSh1dzRw MtaryEX7JNQbietuf3UzcZEcA7H0dxcfS8OspX22H6yxDnY+X1zagZflBmk88FnM Aod1TY/oGi+EJgPd/6pWb9UCvWXsAMAUneeIK910XvkVQ27zp5dxaYCB8z7zqaP5 ZEPM8ol3PwEx2H7hQsd8WTcgk3FAQp/v9bhep+8KnPEA==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=HIAiu+ tWPpIY0T4sFfg7MiHX1opuY5f7NwRmKAg2keU=; b=fmTUp5EIKzztN9zLs2ThHb Ytk6UOCRIywsOimQry1XknZkGmce2kB4ROrILegiaKARwV0iWu/z3Rg2wDYIUn5L 3Qt9kE0vyMf34Bs4Hb3804iV5tXeZSxIWvud9W+uUvS9vzeRgftK5Qm4C0ixbsOT QOSBC3biHrV1EZzpt8JBEe5W3kN7iiCeRH/sm+jC56975DfsQ8rah5c/4NH+Vz0O lY3FYEd2DujSjdxkOtgVZ6kLP+iOcvLESprvHEZ5A6P4DyvnYswr95j8Kxb1Wb7M Z/eHbOO4FlQ54nF6A0TeqnaS5aOM4cGgRvXryYPP0Djj45te/iVGbvjt2p+ZyoKg ==
X-ME-Sender: <xms:alnmXkTjcOY1v73eScYe7IDy71iI654q5WQBe23yzwtfVRQPVADWTw>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudeiiedgudduudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepvffhuffkffgfgggtgfesthekre dttdefjeenucfhrhhomhepmfgvnhcuofhurhgthhhishhonhcuoehmuhhrtghhsehfrghs thhmrghilhdrtghomheqnecuggftrfgrthhtvghrnhepteekuedtffeludekvdeutdefhe egkeefleetleejvdfggfehlefhieelkeehhfejnecukfhppeejgedrjeejrdekhedrvdeh tdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmuh hrtghhsehfrghsthhmrghilhdrtghomh
X-ME-Proxy: <xmx:alnmXhz45UzPMHwkfMi-phPF0WgEx8wYMtpDpXWPPm49H18IIdl3JQ> <xmx:alnmXh0kBFRyekz7ZzPhb-_GBC6l2Jft6rrqGr1M2Zweh32yubFSTQ> <xmx:alnmXoDa1DNGvBAyOhEXsO13aEb6VTzYOoFsd-XaAb61JhmEZkh0DA> <xmx:alnmXkStZIcAZGN0gYgRJcrw2IJWroMdjnHXjp--JEtK2rqr3YHcLA>
Received: from [192.168.1.22] (cpe-74-77-85-250.buffalo.res.rr.com [74.77.85.250]) by mail.messagingengine.com (Postfix) with ESMTPA id 90B4F3280059 for <ietf-http-wg@w3.org>; Sun, 14 Jun 2020 13:07:54 -0400 (EDT)
To: ietf-http-wg@w3.org
From: Ken Murchison <murch@fastmail.com>
Message-ID: <3c80ab15-3fea-04b9-f0b8-76d6864d0143@fastmail.com>
Date: Sun, 14 Jun 2020 13:07:54 -0400
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Transfer-Encoding: 8bit
Content-Language: en-US
Received-SPF: pass client-ip=64.147.123.20; envelope-from=murch@fastmail.com; helo=wout4-smtp.messagingengine.com
X-W3C-Hub-Spam-Status: No, score=-4.8
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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, W3C_AA=-1, W3C_WL=-1
X-W3C-Scan-Sig: mimas.w3.org 1jkW76-0002dA-3A a42fe9c47078a7c416c834f5a8b2f529
X-Original-To: ietf-http-wg@w3.org
Subject: Prefer: return=representation and caching
Archived-At: <https://www.w3.org/mid/3c80ab15-3fea-04b9-f0b8-76d6864d0143@fastmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/37759
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>

All,

Does Prefer: return=representation have any effect on the cacheability 
of PUT and/or POST responses?  I ask the question in a theoretical 
sense, not what is actually implemented in the wild.

Consider a scenario where resources stored on the origin server may 
differ slightly from the actual resources sent in client requests, e.g. 
CalDAV with scheduling resources.

For instance, a CalDAV client will typically make a request such as 
(Content-* headers and body not included for brevity):

PUT /calendar/event1.ics HTTP/1.1
Prefer: return=representation


to avoid the extra round-trip of a subsequent GET to fetch the actually 
stored resource.  The server would respond with something like:

HTTP/1.1 200 OK
Preference-Applied: return=representation
Content-Location: /calendar/event1.ics
Cache-Control: no-cache, maxage=60
ETag: abc


Since the response body for the PUT request is equivalent to the 
response body for a GET request (post-PUT) on the same URI, can/should 
the response be cacheable?


Similarly, for the same reason, a client may do:

POST /calendar;add-member HTTP/1.1
Prefer: return=representation


and receive:

HTTP/1.1 201 Created
Location: /calendar/event2.ics
Preference-Applied: return=representation
Content-Location: /calendar/event2.ics
Cache-Control: no-cache, maxage=60
ETag: xyz


Can/should this response be cacheable for /calendar/event2.ics?

-- 
Kenneth Murchison
Senior Software Developer
Fastmail US LLC