Digest, trailers and buffering was: Re: Updating Digest header RFC3230 using "selected representation"

Lucas Pardue <lucaspardue.24.7@gmail.com> Tue, 23 July 2019 21:43 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 9D3EA120110 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 23 Jul 2019 14:43:28 -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.249, HTML_MESSAGE=0.001, 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=gmail.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 RNmGRSvOrBCb for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Tue, 23 Jul 2019 14:43:26 -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 8CE001200FD for <httpbisa-archive-bis2Juki@lists.ietf.org>; Tue, 23 Jul 2019 14:43:26 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.89) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1hq2XT-0003Cb-FY for ietf-http-wg-dist@listhub.w3.org; Tue, 23 Jul 2019 21:41:39 +0000
Resent-Date: Tue, 23 Jul 2019 21:41:39 +0000
Resent-Message-Id: <E1hq2XT-0003Cb-FY@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 <lucaspardue.24.7@gmail.com>) id 1hq2XR-0003Bq-Ae for ietf-http-wg@listhub.w3.org; Tue, 23 Jul 2019 21:41:37 +0000
Received: from mail-ua1-x943.google.com ([2607:f8b0:4864:20::943]) by titan.w3.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from <lucaspardue.24.7@gmail.com>) id 1hq2XP-0005IM-Mh for ietf-http-wg@w3.org; Tue, 23 Jul 2019 21:41:37 +0000
Received: by mail-ua1-x943.google.com with SMTP id a97so17602833uaa.9 for <ietf-http-wg@w3.org>; Tue, 23 Jul 2019 14:41:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=KayS9kZCtC7T16aZL8iZmOIxjq6ki1GoX6lE2xOMwdQ=; b=psoJnlZ96fm1nE2jfGI/+V9cbBnxQYZfiTUFmbwnCEBSRpdjBxqCEGSCCurryjVnGK /Oi0vum3WinBeV3CSY1Gh/MazXvENs+j+OmVWFvo8e4vI2uU6royFwpI9nNoiO1uYPqz 2hJBppnMWGQK/S31SvmEmMT+1zAXe+7FGfrvtjZCHtaU4xYLhxblVuMO0O/9wkwzn8Xo xhwJcl9j8vuV7PP5XQ8E3rKXa/HQb8zdplMaqJlMhcO6Ob3uGhEk5sN7mexzId6orjSI kHUEZkvTCGW//dGmy8zdUiMoiMcinAdytG6eZMTgk4Bk5C3VKJ/8/juD2NIrPFMR+hEc Fbug==
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:cc; bh=KayS9kZCtC7T16aZL8iZmOIxjq6ki1GoX6lE2xOMwdQ=; b=HAIJ0L44bZTfp/a0SmAzGf5ILMowMQrXqyHqBKO1ipFN9e2tahkR1U1S29DAkfLpbf XuWfhnSya5NQgo9jQ3r06Jr/MnBMZTQ3UsOvnHdlyNljLtfooPVgCfe6IJpGWeekfzRw vo7UIlazKF1LqXFim9/VNihmEwOpcjj/3gNYA+7LJuXIiuOEVhb0lXgcK4211XnyO+WP N83otTGlNaQolz1AJLsLhn1wRQH1dl+da9vhGf70kmAXC5MjjvzOXjNDCYssnnX6Gy29 LkJmB81H1hejXQNdFLqJ9Z86v87lyx4GLYbui9tblyM30VrI/4krldXr6xM87TfpI1bv MJ5Q==
X-Gm-Message-State: APjAAAXuAQ9GeEJchMrOoK8cx/USX3q3vWDNz8BAtfD0bl9zy2KTJgqa agAy014IaeK0fROZQ8PPpjS26GwkMnlUoZYbOjM=
X-Google-Smtp-Source: APXvYqzuT4rTrcTzd7WWNhYhzWho+pLEN+8yuzpxKlD2q7dWqaZ0gDTP5Hnzhy8pRfbFMCPvOLtiLk5enEcYThXplZw=
X-Received: by 2002:ab0:2789:: with SMTP id t9mr33682639uap.69.1563918074535; Tue, 23 Jul 2019 14:41:14 -0700 (PDT)
MIME-Version: 1.0
References: <CAMRHeuyk-xv2oRmcVrFaesneVi4F-EcuttsJU5PKtGrVtP+gSA@mail.gmail.com> <CALGR9obe6mPMCW2O1gf0muWgoT4Nusy8CsoixgENWKTSEf4rGA@mail.gmail.com> <CAMRHeux6=i0Xkg5XPXp8PCZiiLopGkYGTPWztghfzgUx+XF5=Q@mail.gmail.com> <CALGR9oYbZpKMThSJqSAheRfE8NVnDkhMYSbRP-gYnc5-5k8LmQ@mail.gmail.com> <CAChr6SyxGEfV1rHjX8oMLvB-osdgsbjWjkeWAWbPfGAFdC4Zwg@mail.gmail.com> <CAChr6SynBvPB+6yBnKk9z9FFZs0ZynremyntGGyT2Q3S0tmY1g@mail.gmail.com>
In-Reply-To: <CAChr6SynBvPB+6yBnKk9z9FFZs0ZynremyntGGyT2Q3S0tmY1g@mail.gmail.com>
From: Lucas Pardue <lucaspardue.24.7@gmail.com>
Date: Tue, 23 Jul 2019 22:41:02 +0100
Message-ID: <CALGR9oavnNtKXhAAs8aR02TTrWzPVyuW0oQcxe+qqHei7n-pCQ@mail.gmail.com>
To: Rob Sayre <sayrer@gmail.com>
Cc: Roberto Polli <roberto@teamdigitale.governo.it>, HTTP Working Group <ietf-http-wg@w3.org>
Content-Type: multipart/alternative; boundary="0000000000004a6b23058e600d8d"
Received-SPF: pass client-ip=2607:f8b0:4864:20::943; envelope-from=lucaspardue.24.7@gmail.com; helo=mail-ua1-x943.google.com
X-W3C-Hub-Spam-Status: No, score=-2.3
X-W3C-Hub-Spam-Report: AWL=1.574, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, 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: titan.w3.org 1hq2XP-0005IM-Mh e435c2daac52e8022bda0e35ac2a9e67
X-Original-To: ietf-http-wg@w3.org
Subject: Digest, trailers and buffering was: Re: Updating Digest header RFC3230 using "selected representation"
Archived-At: <https://www.w3.org/mid/CALGR9oavnNtKXhAAs8aR02TTrWzPVyuW0oQcxe+qqHei7n-pCQ@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/36827
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 Rob!


On Tue, Jul 23, 2019 Rob Sayre <sayrer@gmail.com>; wrote:

> This draft looks good to me.
>
Thanks.

I think using trailers should work these days, right?
>

HTTP/2 makes carriage of trailers a bit easier but their
applicability/usage really depends on which endpoints we are considering. I
defer to Dragana Damjanovic's nice salient description [1]

"Clients have been hesitant to implement HTTP trailers for years because of
security and consistency concerns with the trailers general case. Browsers
seek to render response bytes as soon as possible, but rendering is the
result of combining the response data with the semantics of the response
headers (e.g., the content-type header informs how a response is
displayed). Generic trailers allow header information to be added after the
rendering has begun, and this has traditionally created concerns about both
correctness and security for supporting trailers."


:On Tue, Jul 23, 2019 at 1:12 PM Rob Sayre <sayrer@gmail.com>; wrote:
>
>> This draft looks good to me.
>>
>> One issue that prevented the adoption of this header and related ones
>> (e.g. Content-MD5) was that HTTP/1.1 trailers had a lot of interoperability
>> problems. This made it expensive for large files, or impossible to use for
>> message bodies that couldn't be pre-calculated.
>>
>
> That last part is slightly wrong. I should have said it was impossible to
> use for message bodies that couldn't be pre-calculated that were also
> streamed. Roughly, these headers required a lot of buffering, and this
> trade-off doesn't seem to be present anymore.
>
> thanks,
> Rob
>

Speaking personally, there is still a challenge of buffering here.
Streaming transfer does not strictly mean streaming consumption.
Progressive consumption implies an ability for progressive digest
calculation, and if that cannot happen then I don't know if sending the
digest as trailer does address trade-offs.

That said, documenting trade offs could be useful for people looking to use
Digest header. At IETF 105 we were asked to add some use cases to the
document. I wonder if you might have a candidate along the lines of this
discussion that we might add for consideration.

Kind regards
Lucas

[1]  https://www.fastly.com/blog/supercharging-server-timing-http-trailers