Re: Cache control in trailers?

Greg Wilkins <gregw@webtide.com> Sat, 06 February 2021 09:34 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 BF7403A0E4D for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sat, 6 Feb 2021 01:34:39 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.67
X-Spam-Level:
X-Spam-Status: No, score=-2.67 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, HTML_MESSAGE=0.001, MAILING_LIST_MULTI=-1, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, 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=webtide-com.20150623.gappssmtp.com
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 CNr9CedjnD6x for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sat, 6 Feb 2021 01:34:35 -0800 (PST)
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 C53F03A0E4C for <httpbisa-archive-bis2Juki@lists.ietf.org>; Sat, 6 Feb 2021 01:34:34 -0800 (PST)
Received: from lists by lyra.w3.org with local (Exim 4.92) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1l8Jwo-00021D-3k for ietf-http-wg-dist@listhub.w3.org; Sat, 06 Feb 2021 09:32:10 +0000
Resent-Date: Sat, 06 Feb 2021 09:32:10 +0000
Resent-Message-Id: <E1l8Jwo-00021D-3k@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 <gregw@webtide.com>) id 1l8Jwm-00020M-II for ietf-http-wg@listhub.w3.org; Sat, 06 Feb 2021 09:32:08 +0000
Received: from mail-oi1-x22f.google.com ([2607:f8b0:4864:20::22f]) by mimas.w3.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from <gregw@webtide.com>) id 1l8Jwj-0003EP-Ux for ietf-http-wg@w3.org; Sat, 06 Feb 2021 09:32:08 +0000
Received: by mail-oi1-x22f.google.com with SMTP id k25so10208822oik.13 for <ietf-http-wg@w3.org>; Sat, 06 Feb 2021 01:32:05 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=webtide-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=qZO/AmuhYovU+S4nx3l8tQ6YLuahuicpuLPCoQ8ry1Q=; b=V5wGFXvGpom8CtekQz/QAzhkLUJJRmeErhnasM/pxzOijln5TVdytYxxhlIuafhRVD XyPWAVl0lo4zh6SrVkqFGGMIH/lD7ZCFSj39YE6SHkfIjecTKQShIoe3AbkhJLr1IlYt vfTRtGmbACpiudUPVcS8ki7LcPw6xJytuwNbwz6D9++XrKtmVXliAh9IJTNffmdYWpJB PvKE7yaQgX0Ey/yjRfR3+3gowKMo5EsFxpbZyo6foZ0Sr97rxf8L2pGsOZhSgVL2W0em w8lyCE0oNLi4EW3hCHGcH9pvrb5E5Pqyhw3nMhokPDoczZRCYME6+QNlA79LPzLYMUdn 5o5g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=qZO/AmuhYovU+S4nx3l8tQ6YLuahuicpuLPCoQ8ry1Q=; b=QK3a9WHwP2oL/ErdFz5mrqoHB+wiQU0++rHDu4zDDuu84L0J4aN0M2smuOmrCTKiHC mLtplTTyhgpvCUsOGF8rfAt733Xicr09S70pnBWYpKHCynZtC3s6pcx/36SxoKkrdClk cVuTUUO4XRf/IY0pR4aXWhIuXrjFq7VcqXaRoXe1eflK3AYdPaYvYWXpgt1ath441zBh U+J3yESa+qj47ax4XKG6u3JMuRYMhbaYpndpBj+ZRl8SxeFs4Hn+54uKevo85HoUtl5C nBis6ZzBIity7tDLXcTfQhYD6BG0gbzp/tlm+B/rLVNBaIjjOYHWl+8S/Gb+xqj+9jyI nDVQ==
X-Gm-Message-State: AOAM533wh11217PTt1yRwpaokWVvX2zE6PwK4Y36s8wthvgBS1J1mJRZ /JekjwK7IPp2plEfHRcoTydXdG/okQSYexMfq+77B/WAQPcjTw==
X-Google-Smtp-Source: ABdhPJyuzYcRLSDFtPV9Ga+0mCH5s68V1t/fzLfRsbY2ELD+G5HcPdtB+7/u9ux5Od9j9eU7rXiU+nivMp0XE7mmDuI=
X-Received: by 2002:aca:d8c6:: with SMTP id p189mr3396000oig.54.1612603914346; Sat, 06 Feb 2021 01:31:54 -0800 (PST)
MIME-Version: 1.0
References: <20210203195031.GD31744@1wt.eu> <58FDCDB1-63A9-4FF1-A348-CCDDC8D19F86@greenbytes.de> <CAAPGdfHH_05piq9JgMiX1BBC1_CQtQ7TUNnzvcmHFFD=TK0Kxw@mail.gmail.com> <6820.1612436015@critter.freebsd.dk> <CAAPGdfHT-_4UM6JWNs1SUSHRzuk+-kdi2wd3Zc66FCUxj9Bq0g@mail.gmail.com> <7752.1612455032@critter.freebsd.dk> <em0f4be291-4358-4a39-bc8f-b3fc2833c46c@bombadil> <10002.1612482759@critter.freebsd.dk> <em968d8077-b288-43a9-89ff-14e5eb551c32@bombadil> <11350.1612510775@critter.freebsd.dk> <20210205074602.GA2292@1wt.eu> <11560.1612511507@critter.freebsd.dk> <CAAPGdfGcZjEOX-eo_1Z_Xu+Vdsv60sCOKuhQG+aiYdLpRh=kDQ@mail.gmail.com> <0ff80246-867f-064d-1035-17564b9d62a8@gmx.de> <CAAPGdfG-QftYscerK=9YskXfA_mn+kfQnjGrBd64Hsm2rYrhrQ@mail.gmail.com> <28266.1612518581@critter.freebsd.dk> <4554B625-851B-42D7-AF78-7D28F8C8E8E9@gbiv.com>
In-Reply-To: <4554B625-851B-42D7-AF78-7D28F8C8E8E9@gbiv.com>
From: Greg Wilkins <gregw@webtide.com>
Date: Sat, 06 Feb 2021 10:31:42 +0100
Message-ID: <CAAPGdfFc5OTdDunYszBv7YXg1aNwkdCEPs-ZZxF_Mgo9=EF=xw@mail.gmail.com>
To: HTTP Working Group <ietf-http-wg@w3.org>
Content-Type: multipart/alternative; boundary="0000000000007a760405baa79b3f"
Received-SPF: pass client-ip=2607:f8b0:4864:20::22f; envelope-from=gregw@webtide.com; helo=mail-oi1-x22f.google.com
X-W3C-Hub-DKIM-Status: validation passed: (address=gregw@webtide.com domain=webtide-com.20150623.gappssmtp.com), signature is good
X-W3C-Hub-Spam-Status: No, score=-3.9
X-W3C-Hub-Spam-Report: BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, W3C_AA=-1, W3C_WL=-1
X-W3C-Scan-Sig: mimas.w3.org 1l8Jwj-0003EP-Ux 648e946fcd3ba9456472bfcb5f40d9fb
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Cache control in trailers?
Archived-At: <https://www.w3.org/mid/CAAPGdfFc5OTdDunYszBv7YXg1aNwkdCEPs-ZZxF_Mgo9=EF=xw@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/38544
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>

Sorry, I'm definitely guilty of getting distracted by the conversation and
forgetting aspects of the trailer mechanism...

Going back to Mark's original post.   He had two proposals: "indicate the
error in trailers"; "to allow Cache-Control: no-cache in trailers".

For the first proposal, I'll repeat my initial feedback: it is a bad idea
to handle errors during generation by correctly terminating a 200 response
in order to put an error status into the trailers.
Clients/intermediaries that don't support the specific error/status field
would see this as a valid response.  Specifically I think it is a bad idea
to do:
    HTTP/1/1 200 OK
    Trailer: end-status
    ... body...
    End-Status: 500

I can only see this as being workable in a 200 response if there is a
really reliable way for the client and all intermediaries to indicate their
support of End-Status specifically and not just support for Trailers
generally.   It could be argued that TE: trailers should indicate support
for all standard fields, but I can't see how it can be assumed to indicate
support for newly defined fields.

For the second proposal, as Roy indicates, it is already possible. So what
exactly is being proposed? Clarifications to the Cache-Control field
definition or a new Cache-Update field?   Again, either way, it does appear
that being able to indicate support for a specific field in the trailers
rather than the trailer mechanism in general would be valuable.






On Fri, 5 Feb 2021 at 20:04, Roy T. Fielding <fielding@gbiv.com> wrote:

> If we are going to continue this conversation, I insist that participants
> actually read the current definition of trailers under WGLC in
>
>
> https://httpwg.org/http-core/draft-ietf-httpbis-semantics-latest.html#trailer.fields
>
> and
>
>
> https://httpwg.org/http-core/draft-ietf-httpbis-semantics-latest.html#field.trailer
>
> and then study existing use beyond what you have implemented yourself.
>
> It takes only five minutes of searching to dig up many articles from people
> using trailers in practice within APIs, CDNs, backend systems, etc.  E.g.,
>
>    https://engineering.pivotal.io/post/http-trailers/
>    https://www.fastly.com/blog/supercharging-server-timing-http-trailers
>    https://webtide.com/http-trailers-in-jetty/
>    https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md
>    https://grpc.github.io/grpc/cpp/md_doc__p_r_o_t_o_c_o_l-_w_e_b.html
>    https://golang.org/pkg/net/http/#example_ResponseWriter_trailers
>    https://github.com/envoyproxy/envoy/issues/2394
>
> HTTP is not limited by what browsers currently use! We should all know that
> by now without me having to repeat it ad nauseum. Browsers are important
> but make up less than 1% of the total HTTP implementations. Nevertheless,
> we have deliberately fixed several aspects of trailers in the revision,
> specifically
> so that they can be better implemented by intermediaries and browsers, and
> won't override header field values by default.
>
> This is not to say that the current description is perfect. It is somewhat
> limited by past definition and usage of trailers and the various ways they
> might be sent for HTTP/1, 2, and 3. We have worked hard to define what
> has been implemented widely now and avoid prohibiting what has only
> been implemented as experiments, such as mid-stream trailers.
>
> Any statements suggesting that trailers are "not in current use" or that
> "nobody implements trailers" are obviously false. They are being used.
> They would be used a lot more if we don't arbitrarily break them without
> understanding the existing implementations.
>
> To answer the original question, there is nothing stopping a server from
> sending
>
>     Cache-Control: must-revalidate
>     Trailer: cache-control
> ... body...
>     Cache-Control: public
>
> or
>
>     Cache-Control: max-age=3200
>     Trailer: end-status
> ... body...
>     End-Status: 500
>
> or
>
>     Cache-Control: max-age=3200
>     Trailer: end-cache-control
> ... body...
>     End-Cache-Control: oops
>
> and simply ask cache implementations to do the right thing once you define
> what that right thing might be. These are already supported by the core
> spec,
> but they would need to be defined as extensions to be interoperable.
>
> Personally, I think end-status is the easiest and most reusable solution,
> for
> any number of features that might need to know if something broke. However,
> Willy is right that saying must-revalidate up front and then softening that
> at the end would be the safer choice where completion is more important
> than default performance. I suggest that choice needs to be
> resource-specific.
>
> Please, if there is something specifically wrong with the current
> definitions
> of Trailers in the specs currently in WGLC, and its not just a personal
> opinion
> about their usage, suggest a better definition that doesn't break other
> people's software, or suggest some additional sentences that might clarify
> the work so that the next generation of apps can use this feature without
> prior shared agreement.
>
> ....Roy
>
>
>

-- 
Greg Wilkins <gregw@webtide.com> CTO http://webtide.com