Re: Call for Adoption: Cache Digests for HTTP/2

Kazuho Oku <kazuhooku@gmail.com> Mon, 27 June 2016 05:33 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 DAF00127078 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sun, 26 Jun 2016 22:33:46 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -8.447
X-Spam-Level:
X-Spam-Status: No, score=-8.447 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.001, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.426, SPF_HELO_PASS=-0.001, SPF_PASS=-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 FkHj9zrvxuNa for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Sun, 26 Jun 2016 22:33:45 -0700 (PDT)
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 F239E12B032 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Sun, 26 Jun 2016 22:33:43 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1bHP78-0006F5-Ax for ietf-http-wg-dist@listhub.w3.org; Mon, 27 Jun 2016 05:29:42 +0000
Resent-Date: Mon, 27 Jun 2016 05:29:42 +0000
Resent-Message-Id: <E1bHP78-0006F5-Ax@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 1bHP72-0006EJ-TR for ietf-http-wg@listhub.w3.org; Mon, 27 Jun 2016 05:29:36 +0000
Received: from mail-wm0-f45.google.com ([74.125.82.45]) by maggie.w3.org with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <kazuhooku@gmail.com>) id 1bHP6z-0002et-Pk for ietf-http-wg@w3.org; Mon, 27 Jun 2016 05:29:36 +0000
Received: by mail-wm0-f45.google.com with SMTP id f126so84991914wma.1 for <ietf-http-wg@w3.org>; Sun, 26 Jun 2016 22:29:13 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=NrrgFsuAM8ik8MpxqjFxCoXPZt6yY/7WhJz5dTrBAew=; b=TcXRBTGuKubgx3XwQeBq/Xfp6fSc1ToGr8SHSyGHagyKsAHKsXV1hf8nc5vpcDFiz1 1Qcgc1K/GF0xv6gwMZyfMuxGwe+1AbtsLa4Zn0t3KFoMgTTHec4DP4kw+NI9ge3RkAOb zM/ti4G5RVQ0xW1NRzTXLJjClj+vqPjvUz3FQipfz8ZbouqWEclZg0KcoJcgMLMSWljO +YR6LmdlUXtnTNXZeaQMQo9E3m59W84UVM8SE8TUYB0uNchqoyy0JKKGBelU3FS3lIvy Y+dbZ7iykhjnNv0f9OUZfRwZkzryTYoj/9ztoRMmvCXlrCB0vu5Y+Mzo1ViOSxLCHQ6o JyaQ==
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:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=NrrgFsuAM8ik8MpxqjFxCoXPZt6yY/7WhJz5dTrBAew=; b=GhkLv1GffHKlF+vgPeTPq8QnDgribzUFGJ65LSNx3j36UUTNjWtefAsbv16DERwWzB ybK5//LgKvik9yn0vJmei01JA83SkPc4UU3bdR1luhM7NAOGcGIafH1qUAr2NFOzElIF fIuHsJ9NXA4tdUB2ALluhsix12+pRs1fncf/8wDcIimTOi1/78LGTO9AlVvZxm8o+4vt 2FOVQt+OCEl6W/PV5aw+uJmhr78nLSg7bxbYDbcOKALssy+nWxq8nn9KULwi+h9CSHAC oeG8aKhmHHCIOdoltGacfdXy3CVoVXTRy7eojMePhz7ycVX3JjwJmOOSXhwEDkrfMcMw B58A==
X-Gm-Message-State: ALyK8tLPyrWYCFOESWIEaD33ZmIdFtVZFLuKggkePi1fN50tH8an++xD2aewsantSsptyTi5rdhqvtR+bPXyKg==
X-Received: by 10.28.17.132 with SMTP id 126mr8747653wmr.90.1467005346706; Sun, 26 Jun 2016 22:29:06 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.194.206.41 with HTTP; Sun, 26 Jun 2016 22:29:05 -0700 (PDT)
In-Reply-To: <CAAMqGzY8tRVS418suitvHtJaDKiBZbpvCi0KBQGt91YZTApynA@mail.gmail.com>
References: <040BA5C3-6CA3-4183-9B33-20D8F7A5CA16@mnot.net> <CAAMqGzbnd9=YJ39sU8K7it-q_Tigw9F7rLOSewMGYL7d1FYFaQ@mail.gmail.com> <F3B609B2-E5B8-4E56-910B-BEB3402329EA@lukasa.co.uk> <CAAMqGzbXk2WHShyrMqG5UNPZVqp7xb1UJLJtjFagC2SihLr=Hw@mail.gmail.com> <CANatvzwHng-jBPMfPMxeDtA9XzG0SNK-_2_LgGj7xR9ApQJQ9Q@mail.gmail.com> <CAAMqGzZ=dZE8-X-CKvgWbPs3km3bCTQeMCU793SsT-oyi2qN6w@mail.gmail.com> <CAAMqGzY8tRVS418suitvHtJaDKiBZbpvCi0KBQGt91YZTApynA@mail.gmail.com>
From: Kazuho Oku <kazuhooku@gmail.com>
Date: Mon, 27 Jun 2016 14:29:05 +0900
Message-ID: <CANatvzxsXAueKCACBpYts4X9Dd_Q-cm71L1g4p2Ze=r4M9Q_YA@mail.gmail.com>
To: Alcides Viamontes E <alcidesv@zunzun.se>
Cc: HTTP Working Group <ietf-http-wg@w3.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=74.125.82.45; envelope-from=kazuhooku@gmail.com; helo=mail-wm0-f45.google.com
X-W3C-Hub-Spam-Status: No, score=-5.5
X-W3C-Hub-Spam-Report: AWL=-0.817, 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 1bHP6z-0002et-Pk 46a58f456490a3b34c6ce624f8c89450
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Call for Adoption: Cache Digests for HTTP/2
Archived-At: <http://www.w3.org/mid/CANatvzxsXAueKCACBpYts4X9Dd_Q-cm71L1g4p2Ze=r4M9Q_YA@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/31794
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>

2016-06-24 0:33 GMT+09:00 Alcides Viamontes E <alcidesv@zunzun.se>:
>
> Hello Kazuho,
>
> Thanks! Comments below.
>
> On Wed, Jun 22, 2016 at 11:29 PM, Kazuho Oku <kazuhooku@gmail.com> wrote:
>>
>> Hello,
>>
>> Thank you for your insights. I am eager to see your experiment results
>> once it gets ready.
>>
>> 2016-06-22 20:39 GMT+09:00 Alcides Viamontes E <alcidesv@zunzun.se>:
>> > Hello Cory,
>> >
>> > It's good to have your feedback. Below are answers to your comments, but
>> > I
>> > do expect to use this conversation to fill my gaps.
>> >
>> > On Wed, Jun 22, 2016 at 12:43 PM, Cory Benfield <cory@lukasa.co.uk>
>> > wrote:
>> >>
>> >>
>> >> > On 22 Jun 2016, at 09:28, Alcides Viamontes E <alcidesv@zunzun.se>
>> >> > wrote:
>> >> >
>> >> > This is bad for several reasons. AFAIK, sites don't have either a way
>> >> > to
>> >> > ask the browser to prematurely evict an expired representation that
>> >> > the
>> >> > browser would otherwise consider fresh. These two things together
>> >> > could
>> >> > allow a cache digest to grow indefinitely. Wouldn't that have a
>> >> > degrading
>> >> > effect on performance?
>> >>
>> >> This is presumably true of caching to begin with, correct? If the
>> >> browser
>> >> doesn’t consider the cached representation stale it is welcome to not
>> >> emit a
>> >> request for it at all, and simply to serve it from its cache. This
>> >> means
>> >> that the cache digest can only grow as large as the client cache allows
>> >> it
>> >> to grow, which I should certainly hope is not indefinitely large!
>> >
>> >
>> > Yes, this is related to caching in general. And it is the reason people
>> > have
>> > to add query strings for doing cache busting. This problem is a separate
>> > issue, but it interacts with cache digests in that old version of assets
>> > are
>> > kept in the cache and  therefore in the cache digest and the origin have
>> > no
>> > way of removing it. The origin can only create a new URL (say, via a new
>> > query string) that gets added to the cache and the cache digest.
>>
>> I share your concern (though I might disagree on how critical the issue
>> is).
>>
>> Actually, the draft provides a way to update fresh responses _if_ the
>> client and server agree.
>>
>> In the current version of the draft, we have intentionally defined
>> VALIDATOR and STALE as separate flags, to allow a client to send a
>> digest of fresh resources with their validators taken into account. A
>> server can use such digest (i.e. a digest with VALIDATOR flag set and
>> STALE flag not set) for pushing an updated version of the resource.
>>
>> So if the client is to accept push of a fresh response to replace an
>> already-existing fresh resource (the HTTP/2 spec. does not specify if
>> it should or not), the mechanism can be used, and in such case, cache
>> busting would no longer be necessary.
>
>
> That's really good news! What can be done to make this mechanism less a
> matter of browser goodwill?

Considering the fact that H2 push is optional (and Cache Digests for
HTTP/2 is an option to H2 push), I am afraid it might not become the
standard way to update a fresh response.

If we are to solve cache busting, it might be better to consider
adding a validator to the link-rel-preload header. For example, we
could add a etag attribute, that presents the etag value that is
_expected_ to be used together with the response that contained the
link header. Upon observing such header, clients can check their
cache, and in case the validators do not match, remove the response
from cache and issue a new request.

In other words,

  link: </style.css>; rel=preload; etag=deadbeef

would instruct the web browser to fetch /style.css if it is not
fresh-cached, or if the etag value of the cached response does not
match the value supplied by the header.

The pros of this approach would be that it could be used over both
HTTP/1 and HTTP/2, and that it does not require the browser to
implement H2 push. The cons would be that it would only be possible to
invalidate responses as part of the preload process.

>>
>>
>> >>
>> >>
>> >> However, it may be sensible to consider providing a SETTINGS field that
>> >> allows servers to flag a maximum size on a cache digest that it is
>> >> willing
>> >> to accept.
>> >
>> >
>> > But this leaves the server without any control about which things are
>> > made
>> > part of the cache digest. That's why we think scoping and an explicit
>> > eviction mechanism are better long term solutions.
>>
>> We could extend the current draft if scoping would be an issue, and it
>> would be possible to do so with keeping backward compatibility. For
>> example, we could add a new flag that indicates that the scope of the
>> digest is limited to certain mime-type and that the mime-type is
>> stored in the frame in addition to the digest-value.
>>
>> That said, does your concern about the size of the digest dissolve
>> without adding a method for a server to notify the client the maximum
>> permitted size of the digest (e.g. a SETTINGS field as suggested by
>> Cory)?
>
>
> After some reflection, I must agree that limiting the size of the digest is
> probably a good compromise until we know if scopes are really needed. This
> setting could even be used to make the digests opt-in, which is a plus.

Thank you for the clarification.

> ./Alcides.
>



-- 
Kazuho Oku