Re: Variants and Client Hints

Yoav Weiss <yoav@yoav.ws> Mon, 16 July 2018 09: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 (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 5B2FE130F83 for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 16 Jul 2018 02:52:41 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -7.659
X-Spam-Level:
X-Spam-Status: No, score=-7.659 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, HTML_MESSAGE=0.001, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, T_DKIMWL_WL_MED=-0.01, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=yoav-ws.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 2OXh381Dxrgs for <ietfarch-httpbisa-archive-bis2Juki@ietfa.amsl.com>; Mon, 16 Jul 2018 02:52:38 -0700 (PDT)
Received: from frink.w3.org (frink.w3.org [128.30.52.56]) (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 542B5130F2C for <httpbisa-archive-bis2Juki@lists.ietf.org>; Mon, 16 Jul 2018 02:52:37 -0700 (PDT)
Received: from lists by frink.w3.org with local (Exim 4.89) (envelope-from <ietf-http-wg-request@listhub.w3.org>) id 1ff08U-0002aY-F5 for ietf-http-wg-dist@listhub.w3.org; Mon, 16 Jul 2018 09:49:42 +0000
Resent-Date: Mon, 16 Jul 2018 09:49:42 +0000
Resent-Message-Id: <E1ff08U-0002aY-F5@frink.w3.org>
Received: from titan.w3.org ([128.30.52.76]) by frink.w3.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from <yoav@yoav.ws>) id 1ff08R-0002Zw-St for ietf-http-wg@listhub.w3.org; Mon, 16 Jul 2018 09:49:39 +0000
Received: from mail-wr1-f43.google.com ([209.85.221.43]) by titan.w3.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from <yoav@yoav.ws>) id 1ff08P-0001Eo-D7 for ietf-http-wg@w3.org; Mon, 16 Jul 2018 09:49:39 +0000
Received: by mail-wr1-f43.google.com with SMTP id c13-v6so31157677wrt.1 for <ietf-http-wg@w3.org>; Mon, 16 Jul 2018 02:49:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yoav-ws.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NXZqeFKbRwcrDxNaryqKCxgFQHgaPXTm+cMhRoOBEGI=; b=gxkj0fsFnoJKzJogXqsncShHH9MwLyWdO961VjymbAwJH/Q04EQahLG2saodA8WDTY 48avtmo46v5SK9YwTlkaLTJIs8o/RpKWO7RhXZCGSCP/SBmlpXWyh+sb0IoouyqX8A5P 7+LZCsPGRw2cgTPiFnnBK1TugAYUKXOadpVb/srQAT543AWFInpuGagiowvxiU80wO58 ozFsNY0PzYyG1+Rh6kvEvvxgGskwJjxdDpxhJHwQ8aILqdN1PvaBZLMMyTIMtv/gVmEh XuEGcgkeZdrmfwig+375KhCFWx4aJZYWvBPozy8gbsWRHkYlilf5lZ03OkDrnBMY4qrZ nhMw==
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=NXZqeFKbRwcrDxNaryqKCxgFQHgaPXTm+cMhRoOBEGI=; b=iJsCgBOGNC+R6X+Ry8kV1kKgjzEz63D6K3bFnNOlt18sKgKPn5T4sZXZYaS8XVG0wO uFQkM9AjgOojUad6rAuWlXAeU/w2H3cN7VpIisDgnos16T1cEacnMitnQudpr9LNoI1c w7slJy/jaXp/GegZ9MLo2qW6vuTez9/9P7B29hxCyXTIQoiyvbXxPc6rHhE3Lq9zCvTN 4vc2kINe6y/JqrHn401AKmj8b0ud9WxZex/ckBfhv7vrRswFGFeD/oPyH8NrV+kYsO0w IBWhlX0VrZrwGflYHYC/7ozEcssNWBFdJ15piAz8ZPTVEzhoCQETpm4/eCWeU9yIW+z/ 1sOw==
X-Gm-Message-State: AOUpUlEkW/P/p0SSEOQtOM02433X9iPO4nh+7UHCIRcY6q+gDxg5vMTd XKZqMRU01psK32Cqlr4W+E3z7nPkNPuq3WiYpHrDtw==
X-Google-Smtp-Source: AAOMgpdghTE+XhoR3vjJQIsuoP2Bw25pTXLo6MYOumcoOjyIUrKvyl7i9F5I7tKpwTRXdzGYkaMWbIIau6mMn9ouLU4=
X-Received: by 2002:adf:ef03:: with SMTP id e3-v6mr10804925wro.182.1531734556035; Mon, 16 Jul 2018 02:49:16 -0700 (PDT)
MIME-Version: 1.0
References: <152524471147.10888.15768344253988846813@ietfa.amsl.com> <CANh-dXmhN3hVKLMiz_8Tr3M_-aZejcDAD+FcTXM7+1J-9=SzBQ@mail.gmail.com> <2DA552F8-076A-486E-8C52-26DEEA658731@mnot.net> <CADXXVKrFBeLJW=Mh70S1bzQct-X440Km_kkacefKE=PwpCsYhg@mail.gmail.com> <2F6C1117-648A-4DBA-BA2C-DB4A9356C7C8@mnot.net> <CACj=BEgtNcKs8LHAkK+Pnh0JeGZk0-0AmM8w4cziJVzXM25Ddw@mail.gmail.com> <847B7CC5-BB40-4C8B-BBB4-7C90FA93485C@mnot.net> <CACj=BEj516WyXgPpqpEE_rRpq12noDyNwU-be8sr4zq+x9LkFw@mail.gmail.com> <11840CF2-22BC-482F-81FA-729DAFAE3E3E@mnot.net>
In-Reply-To: <11840CF2-22BC-482F-81FA-729DAFAE3E3E@mnot.net>
From: Yoav Weiss <yoav@yoav.ws>
Date: Mon, 16 Jul 2018 11:49:04 +0200
Message-ID: <CACj=BEiq+7dCnb+RBxJ9U3cAwXy_DTYzy8YqXyiwtJRrbZdDpw@mail.gmail.com>
To: Mark Nottingham <mnot@mnot.net>
Cc: Ilya Grigorik <igrigorik@google.com>, Jeffrey Yasskin <jyasskin@google.com>, HTTP working group mailing list <ietf-http-wg@w3.org>
Content-Type: multipart/alternative; boundary="0000000000001a5c5c05711abe9c"
X-W3C-Hub-Spam-Status: No, score=-5.4
X-W3C-Hub-Spam-Report: AWL=3.504, BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, W3C_AA=-1, W3C_DB=-1, W3C_IRA=-1, W3C_IRR=-3, W3C_WL=-1
X-W3C-Scan-Sig: titan.w3.org 1ff08P-0001Eo-D7 ba9969ac0bdef432724995e048fb609c
X-Original-To: ietf-http-wg@w3.org
Subject: Re: Variants and Client Hints
Archived-At: <https://www.w3.org/mid/CACj=BEiq+7dCnb+RBxJ9U3cAwXy_DTYzy8YqXyiwtJRrbZdDpw@mail.gmail.com>
Resent-From: ietf-http-wg@w3.org
X-Mailing-List: <ietf-http-wg@w3.org> archive/latest/35696
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>

On Wed, Jun 13, 2018 at 7:27 AM Mark Nottingham <mnot@mnot.net> wrote:

>
>
> > On 8 Jun 2018, at 11:33 am, Yoav Weiss <yoav@yoav.ws> wrote:
> >
> > On Fri, Jun 8, 2018 at 11:12 AM Mark Nottingham <mnot@mnot.net> wrote:
> >> Hi Yoav,
> >>
> >> On 8 Jun 2018, at 10:55 am, Yoav Weiss <yoav@yoav.ws> wrote:
> >>
> >> For example, let's say that we say the rule here is "next smallest." A
> server that prefers quality can take that into account and up the quality
> of their images, relative to the sizes they make available. If they want to
> go back to the origin, they won't use Variants; they'll fall back to Vary.
> >
> > High quality but upscaled images will end up upsetting everyone (as
> they'd end up blurry and bloated).
> >
> > The inverse (i.e. a "next largest" algorithm) might be a better choice,
> but I suspect it won't satisfy some people's use cases.
>
> Hm. A little more?
>
> >> I don't think adding more complexity to the protocol is justified here;
> people can meet their use cases (at least as far as you outline above) with
> just one algorithm.
> >
> > I'm not sure I see how. Could you outline an example?
>
> See below.
>
> >> My thinking to date has been that extra information of this sort could
> be encoded in the available-value if necessary -- but it'd be nice to have
> a worked example. Note that the syntax of available-value opened up in the
> latest draft; if more characters would help, we can figure that out.
> >
> > Are you suggesting that origins will communicate in the available-value
> e.g. the ranges of viewports that an image can satisfy? That may work if we
> ignore the potential cross-conneg-mechanism interactions.
>
> That's one possibility, At the end of the day, available-value is just a
> string under control of the spec, and the algorithm can do pretty much
> anything as long as it produces appropriate outputs (although if it relies
> on inputs not listed, it's going to raise the bar for implementation). The
> tricky bit is likely to be making it succinct.
>
>
> >> That said, the syntax of Variant-Key now allows a response to match
> multiple keys, which at least helps in the duplication issue; see the last
> part of:
> >>
> https://httpwg.org/http-extensions/draft-ietf-httpbis-variants.html#variant-key
> >
> > I agree that's better, but still, the response for `DPR: 2, Viewport:
> 300`, `DPR:1, Viewport: 600` and `DPR: 2, Viewport: 600, Save-Data: on`
> could be one and the same. Avoiding that cache duplication can be an
> important factor.
>
> Right, but that response would have on it something like:
>
> Variants: DPR;1;2, Viewport;600;1200, Save-Data;on;off
> Variant-Key: 1;2, 600, on;off
>
> If that's not expressive enough, maybe we should be talking about a
> Variant-Key syntax that lets you specify alternative sets of values, e.g.,
>
> Variants: DPR;1;2, Viewport;300;600, Save-Data;on;off
> Variant-Key: 2;300;off, 1;600;off, 2;600;on
>

I like the expressiveness that second syntax enables.

Just to clarify: when processing the keys, we're not relying on ordering,
but on the values declared as potential variants, right?

If so, I can see cases where the variants values may have collisions (e.g.
if `Save-Data` were defined as "0" and "1" values, it would collide with
DPR). At the same time, I'm not sure this will be a problem in practice,
and we can probably avoid it becoming a problem by being careful about
future client hint values and their interactions with existing ones.


>
> --
> Mark Nottingham   https://www.mnot.net/
>
>