Re: Submitted new I-D: Cache Digests for HTTP/2

Kazuho Oku <kazuhooku@gmail.com> Mon, 18 January 2016 00:52 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 (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id D5D471ACDD9 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sun, 17 Jan 2016 16:52:19 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.003
X-Spam-Level:
X-Spam-Status: No, score=-7.003 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_HI=-5, RP_MATCHES_RCVD=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham
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 RhubZ2Okjpu6 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sun, 17 Jan 2016 16:52:18 -0800 (PST)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 49BA71ACDE9 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Sun, 17 Jan 2016 16:52:18 -0800 (PST)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1aKy05-00016o-Ib for ietf-http-wg-dist@listhub.w3.org; Mon, 18 Jan 2016 00:48:53 +0000
Resent-Date: Mon, 18 Jan 2016 00:48:53 +0000
Resent-Message-Id: <E1aKy05-00016o-Ib@frink.w3.org>
Received: from maggie.w3.org ([128.30.52.39]) by frink.w3.org with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <kazuhooku@gmail.com>) id 1aKy01-00015T-73 for ietf-http-wg@listhub.w3.org; Mon, 18 Jan 2016 00:48:49 +0000
Received: from mail-wm0-f50.google.com ([74.125.82.50]) by maggie.w3.org with esmtps (TLS1.2:RSA_ARCFOUR_SHA1:128) (Exim 4.80) (envelope-from <kazuhooku@gmail.com>) id 1aKxzy-0001vy-5P for ietf-http-wg@w3.org; Mon, 18 Jan 2016 00:48:48 +0000
Received: by mail-wm0-f50.google.com with SMTP id n5so40732913wmn.0 for <ietf-http-wg@w3.org>; Sun, 17 Jan 2016 16:48:25 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=27LxUKbHs1GB80TBVv4ReaRBJ1G+eYKzJNKWVB+YwFs=; b=evtTe9ViqK0B6E2Qxhc2y40donUs4dx2CJdaL4udVWbFTpuIv4QDsxwlK8LPKmzTzl BbsaBE1hNYnq6fHuFBN70Li1bwaEpifpjFX/KwrLa4npHMU+fdV2ZDTPuE4LcccBXamD mwc1SVYIMB64GvvmsOuexji+/CMmDB7AhQvvk2WmABcJGDN8hrZdifvdRjnKV8V3wc0d ylEI+SLp63utpTV4I+LwLAd93s0WorLgbjPnuM1SYzL5tZoI4zW1RAs/CCoZxyUetonY um9Gt0ITRoZIA3HNDG6C0CluZjoBoM3ei07HE32IHPZXjHP7/+hJfPjk+2QbQt2Isxqd XSfg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=27LxUKbHs1GB80TBVv4ReaRBJ1G+eYKzJNKWVB+YwFs=; b=QCXMcTfM0kFvmiIFxEr8Q5+9quv7ZnWt5QOhquBcM8cBaFw96k43f/a8/5HsOyrN74 Glgnq6cOgb7EuqW0RsDFM+uco05Gm4gj29MEvJqWG7zMoyQ6pYvFzDs+g1uF51aOn2oT npw+AaPDMm/09H+wgLXy5esaUFKn8gR48WGA5CtpNVFN29oRs5baX97BS0TJ3CHewTzp cCxDgjyZow/qgGoRI6BE3L+OgDLlND17ErtlDye3yJhh0zGW3be4oSvoJB5qRPZUjqTy RA6yi1Z8EBKLHgk+gKhmTD5r4DYJ3dG7b5BEPunjCdFPUhmS4aNWex5QJqEzksT6D3sj 3+vA==
X-Gm-Message-State: AG10YORRXAZwNrIH42NKKLgCy4r8zsiEYJj97KADr8MNm2kNd/mtRvnpbMmhOM1/w/C/h3kPafdQybfDSNYEtg==
MIME-Version: 1.0
X-Received: by 10.194.174.36 with SMTP id bp4mr6523109wjc.137.1453078099568; Sun, 17 Jan 2016 16:48:19 -0800 (PST)
Received: by 10.194.235.163 with HTTP; Sun, 17 Jan 2016 16:48:19 -0800 (PST)
In-Reply-To: <CABkgnnWkNynANyjGUkcZBTQjUsVDvDZYA+-zr9BD3+BK3xLNmQ@mail.gmail.com>
References: <CAAMqGzYUoCMxBxUEY9wfLOHZp7nrO4d1q5JZo=96pfEbVS1-ew@mail.gmail.com> <652C3E3A-3DA6-40BB-82FF-01A7D65FF65C@lukasa.co.uk> <CABCZv0piAoDnA1J+2pJ3HyF_iRwj9AaFGfonFjdKGfYr=cGZgQ@mail.gmail.com> <CAKRe7JG16u+MteBz4Rz7iCnHxfhLZ=QbWekrhgNhNkq+pKhVAg@mail.gmail.com> <CANatvzyT_ohm5hEcJ1o8B+AEa70607E-LUnPp5cD8sSO8X0HKA@mail.gmail.com> <56958980.1030307@treenet.co.nz> <CANatvzyOnMSLHfXcDrGSjbtZi5nFX2e9_4tHOjmR2OqBWEYUcg@mail.gmail.com> <EDB7D8A6-9121-4268-8920-223E9BE16B19@greenbytes.de> <CAKRe7JHh9maCnBgODU_rr5TFVmy3Tdm2bwEp2hHsONW8e_LTjw@mail.gmail.com> <CANatvzw6NpbpA_56GbSiCH2yEQoAuaGtXneOvrogBfucqrC8Qw@mail.gmail.com> <CAKRe7JGUUAinAqM9yHnUp0gJm5qwq5xvMhEo+fMnffRW7Kmu7w@mail.gmail.com> <CANatvzxhCXKRFEVJDeJfdMVxP6r+jyOSCcHkY8VHiPNCSF+SwA@mail.gmail.com> <CABkgnnVdR0fi9QKHT=tZUzAzAYe+XxG-oEj=srZGX0TMEkHcuw@mail.gmail.com> <CANatvzwPmZXEpcjE+O2BORq19FgGNGYgs7D7t-t_1O0-x-75KA@mail.gmail.com> <CABkgnnUrbBzKRZZsRzAf93A1Gj3AZQAfNpnBQLRqXzQFnRNwwA@mail.gmail.com> <CANatvzyPDKcuS3rnU9zYvRDXqmsRrqm=Y3+d3xS+a4e+MUZXuw@mail.gmail.com> <CABkgnnWkNynANyjGUkcZBTQjUsVDvDZYA+-zr9BD3+BK3xLNmQ@mail.gmail.com>
Date: Mon, 18 Jan 2016 09:48:19 +0900
Message-ID: <CANatvzxMGnodspx1sfCVOOjuLKBFM-ySFM-1A3yrw7nyMLyugw@mail.gmail.com>
From: Kazuho Oku <kazuhooku@gmail.com>
To: Martin Thomson <martin.thomson@gmail.com>
Cc: Ilya Grigorik <ilya@igvita.com>, Stefan Eissing <stefan.eissing@greenbytes.de>, Amos Jeffries <squid3@treenet.co.nz>, HTTP Working Group <ietf-http-wg@w3.org>
Content-Type: text/plain; charset="UTF-8"
Received-SPF: pass client-ip=74.125.82.50; envelope-from=kazuhooku@gmail.com; helo=mail-wm0-f50.google.com
X-W3C-Hub-Spam-Status: No, score=-5.4
X-W3C-Hub-Spam-Report: AWL=-0.654, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, W3C_AA=-1, W3C_WL=-1
X-W3C-Scan-Sig: maggie.w3.org 1aKxzy-0001vy-5P 2915bc7765b076864e12cf762d4b540b
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Submitted new I-D: Cache Digests for HTTP/2
Archived-At: <http://www.w3.org/mid/CANatvzxMGnodspx1sfCVOOjuLKBFM-ySFM-1A3yrw7nyMLyugw@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/30960
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: <http://www.w3.org/Mail/>
List-Post: <mailto:ietf-http-wg@w3.org>
List-Unsubscribe: <mailto:ietf-http-wg-request@w3.org?subject=unsubscribe>

Under the premise that we are switching to using an HTTP header, my
idea at the moment is to define it like:

  cache-diges = 1#cache-digest-element
  cache-digest-element = cache-digest-nv *(OWS ";" OWS cache-digest-nv)
  cache-digest-nv = fresh-nv / authority-nv

  fresh-nv = "fresh=" fresh-value
  fresh-value = BASE64 encoded GCS defined in h2-cache-digest-00
(without padding)

  authority-nv = "authority=" authority-value
  authority-value =
        authority              # defined in RFC3986
        / wildcard-identifier  # defined in RFC 6125 6.4.3

IMO the definition covers most of the requirements of / suggestions
provided by many, including the 4 points described below:

1. Cache-Digest can be expressed as a header

For example, a Cache-Digest containing https://example.com/style.jss
and https://example.com/jquery.js will look like:

  cache-digest: fresh=AQiZAh8


2. Effective compression with HPACK

A client can make the use of HPACK to effectively compress the
cache-digest that changes slightly per every HTTP request, by
splitting a cache-digest to two headers: a large header that does not
change per every request, and a small header that encodes the delta
from the large header.

For example, a client sends a large cache-digest header in the first
HTTP request after establishing an HTTP/2 connection.

  cache-digest: fresh=ABC...xyz      # very large header

In the following HTTP requests sent over the same connection, a client
will resend the header sent in the first connection, plus a second
header containing the delta from the first connection.

  cache-digest: fresh=ABC...xyz      # the same header as above
  cache-digest: fresh=ax9e           # digest containing delta from above


3. Specifying the scope

In case the server is known to be authoritative for the entire domain
(e.g. wildcard certificate is used), a client can send a cache-digest
for all the hosts under that domain, by specifying the `authority`
attribute.

  cache-digest: fresh=xxxxx; authority=*.example.com


4. Possibility to extend the header

There has been discussions if we should support an encoding other than
GCS, or how we can send cache-digests of a non-fresh resource.

The ABNF has a room to support digests other than just the `fresh`
digest (that represents the fresh resources within the cache using
GCS); for example, we can afterwards define an attribute named
`fresh-bf` for representing a digest of fresh resources using bloom
filter

  cache-digest: fresh-bf=...

or, we can define an attribute named `if-modified-since` to represent
a digest of non-fresh resources, once we agree how they should be
hashed.

  cache-digest: if-modified-since=...


2016-01-15 15:57 GMT+09:00 Martin Thomson <martin.thomson@gmail.com>:
> On 15 January 2016 at 17:51, Kazuho Oku <kazuhooku@gmail.com> wrote:
>> Considering the fact that such APIs (that are incapable of expressing
>> states shared between the requests) exist, I think the semantics
>> should be defined in a way that every HTTP request can be complete by
>> itself if we are going to send cache digest as a header.
>
> Yeah, I agree.  That doesn't preclude a mechanism that explicitly
> creates and references state, but that might be too complex to manage.
> Sending the whole table every time isn't great, but let's see if this
> is successful enough to warrant further optimization first.



-- 
Kazuho Oku