W3C home > Mailing lists > Public > ietf-http-wg@w3.org > October to December 2017

Re: New Version Notification for draft-nottingham-variants-01.txt

From: Mark Nottingham <mnot@mnot.net>
Date: Tue, 31 Oct 2017 10:08:19 +1100
Cc: HTTP Working Group <ietf-http-wg@w3.org>
Message-Id: <7FA10C3E-B6A5-40DD-8E62-C2ED04667651@mnot.net>
To: "Julian F. Reschke" <julian.reschke@gmx.de>
On 30 Oct 2017, at 10:13 pm, Julian Reschke <julian.reschke@gmx.de> wrote:
> On 2017-10-30 05:41, Mark Nottingham wrote:
>> FYI, an update of Variants.
>> This one removes the requirement for conneg mechanisms to identify their own response header ("Content-*"), in favour of a central one -- Variant-Key.
>> Doing so avoids the big problem with Variants-00, where the semantics of a header like Content-Encoding could clash with variants' needs.
>> So, you now have a response that looks something like:
>> Vary: Accept-Encoding, Accept-Language
>> Variants: Accept-Encoding;gzip;br, Accept-Language;fr;en;jp
>> Variant-Key: gzip,en
>> ... which roughly translates to "There are gzip, brotli and identity representations of this resource, in French, English and Japanese; THIS representation is the gzip'd English one."
>> ...
> Looking at the examples, they seem a bit chatty. Can't we collapse this into a single field, like:
> Variants: Accept-Encoding;available="gzip br";selected=gzip, Accept-Language;available="fr en jp";selected=en
> ? (and yes, we could abbreviate the parameter names).

I considered that, but it seems like making them separate will make at least the Variants header (in the current design) more likely to get a hit in HPACK. Also, even with shorter parameter names, it seems like this approach is actually more verbose, in terms of character counts -- especially when the list gets long.

> Also, looking at my made up syntax using whitespace as separator reminds me that picking the separator is tricky, and in particular the semicolon might not work well in all cases. For instance, what if the server was negotiating on "Accept" and take parameters into account? (see example in <https://www.greenbytes.de/tech/webdav/rfc7231.html#rfc.section.5.3.2.p.10>).
> So, whatever the syntax is we probably need an escaping mechanism for edge cases...

Yes (and that's another reason for separating the headers, I think). However, keep in mind that available-values doesn't *have* to be the values sent in the request headers; it can be computed to something else.

Also, I very much wonder whether including parameters is a good idea for Accept.

> Finally, a question about <https://mnot.github.io/I-D/variants/#rfc.section.3>:
>> Note that the contents of Variant-Key are only used to indicate what request attributes are identified with the response containing it; this is different from headers like Content-Encoding, which indicate attributes of the response. In the example above, it might be that a gzip’d version of the French content is not available, in which case it will not include “Content-Encoding: gzip”, but still have “gzip” in Variant-Key.
> Am I right that this just follows from the syntax that requires Variants and Variant-Keys have the same number of list elements? That might be another reason to collapse things into a single field.


Mark Nottingham   https://www.mnot.net/
Received on Monday, 30 October 2017 23:08:46 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 8 November 2017 00:14:14 UTC