Re: New Version Notification for draft-vkrasnov-h2-compression-dictionaries-01.txt

Vlad Krasnov <vlad@cloudflare.com> Wed, 02 November 2016 18:15 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 6849A1294BB for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 2 Nov 2016 11:15:23 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.998
X-Spam-Level:
X-Spam-Status: No, score=-7.998 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_SORBS_SPAM=0.5, RP_MATCHES_RCVD=-1.497, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=cloudflare.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 Pjfi2gbcAgFp for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Wed, 2 Nov 2016 11:15:22 -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 26DE8129784 for <httpbisa-archive-bis2Juki@lists.ietf.org>; Wed, 2 Nov 2016 11:15:18 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.80) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1c2000-0000H6-N0 for ietf-http-wg-dist@listhub.w3.org; Wed, 02 Nov 2016 18:10:56 +0000
Resent-Date: Wed, 02 Nov 2016 18:10:56 +0000
Resent-Message-Id: <E1c2000-0000H6-N0@frink.w3.org>
Received: from mimas.w3.org ([128.30.52.79]) by frink.w3.org with esmtps (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from <vlad@cloudflare.com>) id 1c1zzt-0000Fw-Bc for ietf-http-wg@listhub.w3.org; Wed, 02 Nov 2016 18:10:49 +0000
Received: from mail-pf0-f169.google.com ([209.85.192.169]) by mimas.w3.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from <vlad@cloudflare.com>) id 1c1zzn-0002yf-K2 for ietf-http-wg@w3.org; Wed, 02 Nov 2016 18:10:44 +0000
Received: by mail-pf0-f169.google.com with SMTP id i88so15800155pfk.2 for <ietf-http-wg@w3.org>; Wed, 02 Nov 2016 11:10:23 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloudflare.com; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=8i6CfiKwdB0wfC0tBapu2xCmquusnsVGrh/dJoph5b4=; b=bMHWrRLoorsM3tXwlcAuTMJwmKFvvjFY8KHHy9LSyAl0FL7JpUnZQA16w3g9EhOY9V zKjEMSolR6iGTuXKZHLW2wjHj2g55PSj+VjEwDObVZ03Q7QzTcWmXa4y3XxdboXkeegy ue9EBFetGtCd5Qk566uHKre+QaKx+QIuq76cg=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=8i6CfiKwdB0wfC0tBapu2xCmquusnsVGrh/dJoph5b4=; b=UFL1T+kuIQYAGtp9X+IlUk5MKP+c9hcHyo9Tk8eCJQx5eBVOZzYFLsWGB+J2jNDbBF +h7IcMfV3khI0WjiWCcF5K9BONsBXA8ZeIkoyAe0XqBlLyKg9paFmziTfi2u6au7P5pg KZVSp4FAvvCx7F2t1+MV3MJ37ZC9tgBja67qHido4th3nZpctNaXpZzYTOyy1N4nP9Tf V0zxVEjDBpAjR71Xm+Q1JOGI8B1N+ELW8jLIkWgsbQhJEkiX0A/tx+nniXQaMLgFqA+F WCihIft/+db6RSg7Z9BAFbHenAiflF3KtEeUnKQ+gXD8+MUF3nt7emGkKg7lO9p4ZhQB mdzg==
X-Gm-Message-State: ABUngvfQqWoAVr0KGFar3rSxM5PGSoyl2hWsafvDF7ZQfqWNcsMhVYQfCMu4rrQ7Wc7XKO+j
X-Received: by 10.98.138.79 with SMTP id y76mr9229838pfd.158.1478110217050; Wed, 02 Nov 2016 11:10:17 -0700 (PDT)
Received: from ?IPv6:2601:645:8302:ef30:2cf6:a89:106c:18c1? ([2601:645:8302:ef30:2cf6:a89:106c:18c1]) by smtp.gmail.com with ESMTPSA id cp2sm6409287pad.3.2016.11.02.11.10.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Nov 2016 11:10:16 -0700 (PDT)
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 10.1 \(3251\))
From: Vlad Krasnov <vlad@cloudflare.com>
In-Reply-To: <CABkgnnXqHP6RNpHBcFStO5TWz8Sq6Uqs7KMWFof88RjxhoW-Qg@mail.gmail.com>
Date: Wed, 2 Nov 2016 11:10:15 -0700
Cc: HTTP Working Group <ietf-http-wg@w3.org>
Content-Transfer-Encoding: quoted-printable
Message-Id: <68453225-6638-4203-AD19-ED9D2AD3A61E@cloudflare.com>
References: <147793576451.32369.14134057573457350871.idtracker@ietfa.amsl.com> <3669167D-26AC-4B78-8175-99B0028B6891@cloudflare.com> <CABkgnnXqHP6RNpHBcFStO5TWz8Sq6Uqs7KMWFof88RjxhoW-Qg@mail.gmail.com>
To: Martin Thomson <martin.thomson@gmail.com>
X-Mailer: Apple Mail (2.3251)
Received-SPF: pass client-ip=209.85.192.169; envelope-from=vlad@cloudflare.com; helo=mail-pf0-f169.google.com
X-W3C-Hub-Spam-Status: No, score=-4.2
X-W3C-Hub-Spam-Report: BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001, W3C_AA=-1, W3C_WL=-1
X-W3C-Scan-Sig: mimas.w3.org 1c1zzn-0002yf-K2 b16c6e05db34c932b3221367e1c48722
X-Original-To: ietf-http-wg@w3.org
Subject: Re: New Version Notification for draft-vkrasnov-h2-compression-dictionaries-01.txt
Archived-At: <http://www.w3.org/mid/68453225-6638-4203-AD19-ED9D2AD3A61E@cloudflare.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/32813
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>

> The document is really light on details regarding how to use a
> dictionary.  I realize that this might /seem/ obvious, but it really
> needs to explain how better (up front preferably) how it is intended
> to work.  In particular, how do I tell what compression algorithm to
> feed the dictionary into?  HTTP/2 doesn't know about compression, in
> particular, HTTP/2 really *can't* use content-encoding.

Actually I was in the mind of reusing accept-encoding/content-encoding for this.

> I see that you have settings for the number of dictionaries, and the
> size of those dictionaries, this is good, but I think that you need to
> set an overall limit instead of a per-dictionary limit
> SETTINGS_MAX_DICTIONARY_SIZE (you get better efficiency that way).

That sounds like a good idea. 
The benefit of having a per-dictionary limit, is that when you append a stream to an existing dictionary it is implied you only keep the maximal allowed amount of bytes.
After all there is no point of having a dictionary larger than your window.
With a global limit you might want to specify how many bytes to keep explicitly, that creates additional overhead.
Maybe combine both?

> I like the idea of static dictionaries, but your structure would force
> an implementation to support ALL static dictionaries if they wanted to
> support ANY dynamic dictionaries.  That might be inadvisable.  A
> separate setting would be better I think.  (Static dictionaries could
> start from the top of the numbering space, perhaps, so that you can
> have many static dictionaries.)

There a few options I considered for static dictionaries, and all of them are acceptable for me.
Currently I went for the cheapest option in terms of implementation simplicity/overhead.

> The security considerations need a lot more detail about when it is
> safe to use a compression dictionary, etc.

It should be OK compress same origin, self referenced requests, this however degrades performance on sharded websites.
Also the use of static dictionaries is quite safe.