Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi variant key #571

Merged
merged 6 commits into from Apr 19, 2018
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 4 additions & 4 deletions draft-ietf-httpbis-variants.md
Expand Up @@ -79,7 +79,7 @@ Provided that the cache has full knowledge of the semantics of Accept-Language a

This specification introduces the HTTP Variants response header field ({{variants}}) to enumerate the available variant representations on the origin server, to provide clients and caches with enough information to properly satisfy requests -- either by selecting a response from cache or by forwarding the request towards the origin -- by following the algorithm defined in {{cache}}.

Its companion the Variant-Key response header field ({{variant-key}}) indicates which representation was selected, so that it can be reliably reused in the future. When this specification is in use, the example above might become:
Its companion Variant-Key response header field ({{variant-key}}) indicates the applicable key(s) that the response is associated with, so that it can be reliably reused in the future. When this specification is in use, the example above might become:

~~~
GET /foo HTTP/1.1
Expand Down Expand Up @@ -179,7 +179,7 @@ In practice, implementation of Vary varies considerably. As a result, cache effi

# The "Variant-Key" HTTP Header Field {#variant-key}

The Variant-Key HTTP response header field is used to indicate the value(s) from the Variants header field that identify the representation it occurs within.
The Variant-Key HTTP response header field is used to indicate the values from the Variants header field that identify the representation it occurs within.

~~~
Variant-Key = available-values
Expand All @@ -206,7 +206,7 @@ Variants: Content-Encoding;gzip;br, Content-Language;en ;fr
Variant-Key: gzip;identity, fr
~~~

Indicates that this response can be used for requests whose Content-Encoding algorithm selects "gzip" or "identity", as long as the Content-Language algorithm selects "fr" -- perhaps because there is no gzip-compressed French representation.
indicates that this response can be used for requests whose Content-Encoding algorithm selects "gzip" or "identity", as long as the Content-Language algorithm selects "fr" -- perhaps because there is no gzip-compressed French representation.

This highlights an important aspect of Variant-Key; it is only used to indicate what request attributes are associated with the response containing it; this is different from headers like Content-Encoding, which indicate attributes of the response itself.

Expand All @@ -225,7 +225,7 @@ Given stored-headers, a set of headers from a stored response, a normalised list
1. Remove all whitespace from value.
2. Let items be the result of splitting value on ";".
3. append items to variant-keys.
5. Return result of running Compute Possible Keys ({{find}}) on variant-keys, an empty string and an empty list.
5. Return the result of running Compute Possible Keys ({{find}}) on variant-keys, an empty string and an empty list.


# Cache Behaviour {#cache}
Expand Down