Convert Variants to use Structured Headers.#744
Conversation
de8e409 to
59e6719
Compare
mnot
left a comment
There was a problem hiding this comment.
This looks good; just one immediate issue I can see (although I might tweak some once it's in).
Thanks!
|
|
||
| indicates that this response can be used for requests whose Accept-Encoding algorithm selects "gzip" or "identity", as long as the Accept-Language algorithm selects "fr" -- perhaps because there is no gzip-compressed French representation. | ||
|
|
||
| When more than one Variant-Key value is in a response, the first one present MUST indicate the variant-key for the response it occurs within. |
There was a problem hiding this comment.
This requirement addresses an implementation constraint; if they can't easily link a response to multiple potential requests, this allows them to still behave correctly (if not optimally). Why did you remove it?
There was a problem hiding this comment.
I don't remember exactly what I was thinking, but it seems redundant right now. All of the variant-key values are variant-keys for the response they occur within, so of course the first one is also a variant-key for that response. Do you mean that the first variant-key list item should be the "best"? And that caches MAY discard subsequent ones?
There was a problem hiding this comment.
The wording above doesn't reflect the intent well. It should be:
When more than one Variant-Key value is in a response, the first one present MUST correspond to the request that caused that response to be generated.
There was a problem hiding this comment.
Ah, that makes sense. I've added your wording back.
I think it could be wordsmithed a little better now that Variant-Key is a structured header, but I don't want to delay merging the overall change. Specifically, "more than one Variant-Key value" implies to me that the Variant-Key header appears more than once, but we actually mean that the list parsed for Variant-Key from a response contains more than one inner-list, even if they're all parsed from a single instance of the header.
59e6719 to
fd98d61
Compare
A response's request's key must be listed first.
Fixes #570. I think this also fixes #743, but I might have missed something.
Misc changes that aren't actually necessary to use Structured Headers:
token / "/" / "?" / "\" / "[" / "]" / ":" / "@" / "(" / ")"definition of available-value in favor of allowing arbitrary Structured Header strings. It wasn't clear what excluding characters like{was gaining us, and the restriction would have required extra words when parsing the headers.Variant-Key. It would be difficult to keep the old behavior of returning a list of strings without re-adding some restriction on an available-value, for example by requiring that they don't contain spaces.