diff --git a/.gitignore b/.gitignore index ae7700d..deb66c5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -no-vary-search.html prefetch.html prerendering.html speculation-rules.html diff --git a/Makefile b/Makefile index e9ab07b..a22ba79 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ SHELL=/bin/bash -bikeshed_files = no-vary-search.bs prefetch.bs prerendering.bs speculation-rules.bs +bikeshed_files = prefetch.bs prerendering.bs speculation-rules.bs +html_files = index.html no-vary-search.html .PHONY: ci clean local remote @@ -9,7 +10,7 @@ local: $(bikeshed_files) remote: $(bikeshed_files:.bs=.html) -ci: index.html $(bikeshed_files:.bs=.html) +ci: $(html_files) $(bikeshed_files:.bs=.html) mkdir -p out cp $^ out/ diff --git a/no-vary-search.bs b/no-vary-search.bs deleted file mode 100644 index e988ec8..0000000 --- a/no-vary-search.bs +++ /dev/null @@ -1,355 +0,0 @@ -
-Title: No-Vary-Search -Shortname: no-vary-search -Group: WICG -Status: CG-DRAFT -Repository: WICG/nav-speculation -URL: https://wicg.github.io/nav-speculation/no-vary-search.html -Level: 1 -Editor: Domenic Denicola, Google https://www.google.com/, d@domenic.me -Abstract: A proposed HTTP header field for changing how URL search parameters impact caching -Markup Shorthands: css no, markdown yes -Assume Explicit For: yes -Complain About: accidental-2119 yes, missing-example-ids yes -Indent: 2 -Boilerplate: omit conformance --
-spec: RFC8941; urlPrefix: https://www.rfc-editor.org/rfc/rfc8941.html - type: dfn - text: structured header; url: #section-1 - for: structured header - text: dictionary; url: name-dictionaries - text: boolean; url: name-boolean - text: inner list; url: name-inner-lists - text: parsing structured fields; url: #text-parse -- - -
No-Vary-Search
\` HTTP header field is a [=structured header=] whose value must be a [=structured header/dictionary=].
-
-TODO: probably give some more introductory non-normative text. Look at what other HTTP field defintions do.
-
-It has the following authoring conformance requirements:
-
-* If present, the `key-order` entry's value must be a [=structured header/boolean=].
-* If present, the `params` entry's value must be either a [=structured header/boolean=] or an [=structured header/inner list=].
-* If present, the `except` entry's value must be a [=structured header/inner list=].
-* The `except` entry must only be present if the `params` entry is also present, and the `params` entry's value is the boolean value true.
-
-The dictionary may contain entries whose keys are not one of `key-order`, `params`, and `except`, but their meaning is not defined by this specification. Implementations of this specification will ignore such entries (but future documents may assign meaning to such entries).
-
-As always, the authoring conformance requirements are not binding on implementations. Implementations instead need to implement the processing model given by the [=obtain a URL search variance=] algorithm. - -
In general, this algorithm is strict and tends to return the [=default URL search variance=] whenever it sees something it doesn't recognize. This is because the [=default URL search variance=] behavior will just cause fewer cache hits, which is an acceptable fallback behavior.
- -However, unrecognized keys at the top level are ignored, to make it easier to extend this specification in the future. To avoid misbehavior with existing client software, such extensions will likely expand, rather than reduce, the set of requests that a cached response can match.
-Input | -Result | -
---|---|
No-Vary-Search: params- | - * [=URL search variance/no-vary params=]: [=URL search variance/no-vary params/wildcard=] - * [=URL search variance/vary params=]: (empty list) - |
No-Vary-Search: params=("a")- | - * [=URL search variance/no-vary params=]: « "`a`" » - * [=URL search variance/vary params=]: [=URL search variance/vary params/wildcard=] - |
No-Vary-Search: params, except=("x")- | - * [=URL search variance/no-vary params=]: [=URL search variance/no-vary params/wildcard=] - * [=URL search variance/vary params=]: « "`x`" » - |
Input - | Conventional form - |
---|---|
No-Vary-Search: params=?1- | No-Vary-Search: params- |
No-Vary-Search: key-order=?1- | No-Vary-Search: key-order- |
No-Vary-Search: params, key-order, except=("x")- | No-Vary-Search: key-order, params, except=("x")- |
No-Vary-Search: params=?0- | (omit the header) - |
No-Vary-Search: params=()- | (omit the header) - |
No-Vary-Search: key-order=?0- | (omit the header) - |
application/x-www-form-urlencoded
format allows encoding an entire entry list of keys and values in ASCII URL format. For example,
-
- No-Vary-Search: params=("%C3%A9+%E6%B0%97")- - will result in a [=URL search variance=] whose [=URL search variance/vary params=] are « "`é 気`" ». As explained in a later example, the canonicalization process during [=equivalent modulo search variance|equivalence testing=] means this will treat as equivalent URL strings such as: - - * `https://example.com/?é 気=1` - * `https://example.com/?é+気=2` - * `https://example.com/?%C3%A9%20気=3` - * `https://example.com/?%C3%A9+%E6%B0%97=4` - - and so on, since they all are [=urlencoded parser|parsed=] to having the same key "`é 気`". -
In this case, even [=URL=] pairs that might appear the same after running the [=urlencoded parser|application/x-www-form-urlencoded parser=] on their [=url/queries=], such as `https://example.com/a` and `https://example.com/a?`, or `https://example.com/foo?a=b&&&c` and `https://example.com/foo?a=b&c=`, will be treated as inequivalent. - -1. Let |searchParamsA| and |searchParamsB| be empty [=lists=]. - -1. If |urlA|'s [=url/query=] is not null, then set |searchParamsA| to the result of running the [=urlencoded parser|application/x-www-form-urlencoded parser=] given the [=isomorphic encoding=] of |urlA|'s [=url/query=]. - -1. If |urlB|'s [=url/query=] is not null, then set |searchParamsB| to the result of running the [=urlencoded parser|application/x-www-form-urlencoded parser=] given the [=isomorphic encoding=] of |urlB|'s [=url/query=]. - -1. If |searchVariance|'s [=URL search variance/no-vary params=] is a [=list=], then: - - 1. Set |searchParamsA| to a [=list=] containing those [=list/items=] |pair| in |searchParamsA| where |searchVariance|'s [=URL search variance/no-vary params=] does not [=list/contain=] |pair|[0]. - - 1. Set |searchParamsB| to a [=list=] containing those [=list/items=] |pair| in |searchParamsB| where |searchVariance|'s [=URL search variance/no-vary params=] does not [=list/contain=] |pair|[0]. - -1. Otherwise, if |searchVariance|'s [=URL search variance/vary params=] is a [=list=], then: - - 1. Set |searchParamsA| to a [=list=] containing those [=list/items=] |pair| in |searchParamsA| where |searchVariance|'s [=URL search variance/vary params=] [=list/contains=] |pair|[0]. - - 1. Set |searchParamsB| to a [=list=] containing those [=list/items=] |pair| in |searchParamsB| where |searchVariance|'s [=URL search variance/vary params=] [=list/contains=] |pair|[0]. - -1. If |searchVariance|'s [=URL search variance/vary on key order=] is false, then: - - 1. Let |keyLessThan| be an algorithm taking as inputs two pairs (|keyA|, valueA) and (|keyB|, valueB), which returns whether |keyA| is [=code unit less than=] |keyB|. - - 1. Set |searchParamsA| to the result of [=list/sorting in ascending order=] |searchParamsA|, with |keyLessThan|. - - 1. Set |searchParamsB| to the result of [=list/sorting in ascending order=] |searchParamsB|, with |keyLessThan|. - -1. If |searchParamsA|'s [=list/size=] is not equal to |searchParamsB|'s [=list/size=], then return false. - -1. Let |i| be 0. - -1. [=iteration/While=] |i| < |searchParamsA|'s [=list/size=]: - - 1. If |searchParamsA|[|i|][0] does not equal |searchParamsB|[|i|][0], then return false. - - 1. If |searchParamsA|[|i|][1] does not equal |searchParamsB|[|i|][1], then return false. - - 1. Set |i| to |i| + 1. - -1. Return true. - -
Equivalent URL strings - | Explanation - |
---|---|
`https://example.com/` - | A null [=url/query=] is parsed the same as an empty string query - |
`https://example.com/?` - | |
`https://example.com/?a=x` - | Parsing performs percent-decoding - |
`https://example.com/?%61=%78` - | |
`https://example.com/?a=é` - | Parsing performs percent-decoding - |
`https://example.com/?a=%C3%A9` - | |
`https://example.com/?a=%f6` - | Both values are parsed as U+FFFD (�) - |
`https://example.com/?a=%ef%bf%bd` - | |
`https://example.com/?a=x&&&&` - | Parsing splits on `&` and discards empty strings - |
`https://example.com/?a=x` - | |
`https://example.com/?a=` - | Both parse as having an empty string value for `a` - |
`https://example.com/?a` - | |
`https://example.com/?a=%20` - | `+` and `%20` are both parsed as U+0020 SPACE - |
`https://example.com/?a=+` - | |
`https://example.com/?a= &` - |
This work has moved to the IETF HTTP working group. You will be redirected to the latest revision shortly.
diff --git a/no-vary-search.md b/no-vary-search.md index a1ef90e..ed737da 100644 --- a/no-vary-search.md +++ b/no-vary-search.md @@ -1,5 +1,9 @@ # The `No-Vary-Search` HTTP response header +> [!IMPORTANT] +> Work on this feature has moved to the IETF HTTP working group. +> The [latest draft](https://httpwg.org/http-extensions/draft-ietf-httpbis-no-vary-search.html) and [issue tracker](https://github.com/httpwg/http-extensions/labels/no-vary-search) can be found there. + Caching is useful for making web pages load faster, and thus creating better user experiences. Prominent caches on the web platform include the HTTP cache, as well as the subjects of this repository, the prefetch and prerender caches. One of the most important cache keys for web resources is the resource's URL. However, sometimes multiple URLs can represent the same resource. This leads to caches not always being as helpful as they could be: if the browser has the resource cached under one URL, but the resource is then requested under another, the cached version will be ignored. diff --git a/prefetch.bs b/prefetch.bs index e43448d..f6b9bff 100644 --- a/prefetch.bs +++ b/prefetch.bs @@ -128,11 +128,11 @@ spec: nav-speculation; urlPrefix: prerendering.html text: getting the supported loading modes; url: get-the-supported-loading-modes text: uncredentialed-prefetch; for: Supports-Loading-Mode; url: supports-loading-mode-uncredentialed-prefetch text: prerendering traversable; url: prerendering-traversable -spec: nav-speculation; urlPrefix: no-vary-search.html +spec: no-vary-search; urlPrefix: https://httpwg.org/http-extensions/draft-ietf-httpbis-no-vary-search.html type: dfn - text: URL search variance; url: url-search-variance - text: obtain a URL search variance; url: obtain-a-url-search-variance - text: equivalent modulo search variance; url: equivalent-modulo-search-variance + text: URL search variance; url: name-data-model + text: obtain a URL search variance; url: name-obtain-a-url-search-varianc + text: equivalent modulo search variance; url: name-comparing spec: resource-timing; urlPrefix: https://w3c.github.io/resource-timing/ type: dfn; for: PerformanceResourceTiming; text: delivery type; url: dfn-delivery-type @@ -785,10 +785,10 @@ The following parameters are defined for the "`prefetch`" token: See Security considerations (Speculation Rules). -For the integration of this spec with No-Vary-Search, see No-Vary-Search Security considerations. +For the integration of this spec with No-Vary-Search, see No-Vary-Search Security considerations.Add security considerations that are specific to prerendering. See issue #319.
@@ -1026,6 +1026,6 @@ For the integration of this spec with No-Vary-Search, see Privacy considerations (Speculation Rules). -For the integration of this spec with No-Vary-Search, see No-Vary-Search Privacy considerations. +For the integration of this spec with No-Vary-Search, see No-Vary-Search Privacy considerations.Add privacy considerations that are specific to prerendering. See issue #319.
diff --git a/speculation-rules.bs b/speculation-rules.bs index fc0b927..9397562 100644 --- a/speculation-rules.bs +++ b/speculation-rules.bs @@ -85,12 +85,12 @@ spec: nav-speculation; urlPrefix: prerendering.html text: start referrer-initiated prerendering; url: start-referrer-initiated-prerendering text: prerendering traversable; url: prerendering-traversable text: activate; for: prerendering traversable; url: prerendering-traversable-activate -spec: nav-speculation; urlPrefix: no-vary-search.html +spec: no-vary-search; urlPrefix: https://httpwg.org/http-extensions/draft-ietf-httpbis-no-vary-search.html type: dfn - text: URL search variance; url: url-search-variance - text: default URL search variance; url: default-url-search-variance - text: obtain a URL search variance hint; url: obtain-a-url-search-variance-hint - text: equivalent modulo search variance; url: equivalent-modulo-search-variance + text: URL search variance; url: name-data-model + text: default URL search variance; url: iref-default-url-search-variance + text: obtain a URL search variance; url: name-obtain-a-url-search-varianc + text: equivalent modulo search variance; url: name-comparing