You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<dfn method for="CacheStorage"><code>match(|request|, |options|)</code></dfn> method *must* run these steps:
1938
1941
1939
-
1. If |options|.{{CacheQueryOptions/cacheName}} is [=present=], then:
1942
+
1. If |options|.{{MultiCacheQueryOptions/cacheName}} is [=present=], then:
1940
1943
1. Return [=a new promise=] |promise| and run the following substeps [=in parallel=]:
1941
1944
1. [=map/For each=] |cacheName| → |cache| of the [=relevant name to cache map=]:
1942
-
1. If |options|.{{CacheQueryOptions/cacheName}} matches |cacheName|, then:
1945
+
1. If |options|.{{MultiCacheQueryOptions/cacheName}} matches |cacheName|, then:
1943
1946
1. Resolve |promise| with the result of running the algorithm specified in {{Cache/match(request, options)}} method of {{Cache}} interface with |request| and |options| (providing |cache| as thisArgument to the `[[Call]]` internal method of {{Cache/match(request, options)}}.)
1. If |options|.{{CacheQueryOptions/ignoreMethod}} is false and |request|'s [=request/method=] is not \`<code>GET</code>\`, return |resultList|.
3200
-
1. Let |cachedURL| and |requestURL| be null.
3201
3202
1. Let |storage| be null.
3202
3203
1. If the optional argument |targetStorage| is omitted, set |storage| to the [=relevant request response list=].
3203
3204
1. Else, set |storage| to |targetStorage|.
3204
3205
1. [=list/For each=] |requestResponse| of |storage|:
3205
-
1. Set |cachedURL| to |requestResponse|'s request's [=request/url=].
3206
-
1. Set |requestURL| to |request|'s [=request/url=].
3207
-
1. If |options|.{{CacheQueryOptions/ignoreSearch}} is true, then:
3208
-
1. Set |cachedURL|'s [=url/query=] to the empty string.
3209
-
1. Set |requestURL|'s [=url/query=] to the empty string.
3210
-
1. If |cachedURL| [=url/equals=] |requestURL| with the *exclude fragment flag* set, then:
3211
-
1. Add a copy of |requestResponse|'s request to |requests|.
3212
-
1. Add a copy of |requestResponse|'s response to |responses|.
3213
-
1. Let |index| be zero.
3214
-
1. For each |cachedResponse| in |responses|:
3215
-
1. Let |cachedRequest| be |requests|[|index|].
3216
-
1. Increment |index| by one.
3217
-
1. If |cachedResponse|'s [=response/header list=] contains no <a>header</a>[=header/named=] \`<code>Vary</code>\`, or |options|.{{CacheQueryOptions/ignoreVary}} is true, then:
3218
-
1. [=list/Append=] |cachedRequest|/|cachedResponse| to |resultList|.
3219
-
1. [=Continue=].
3220
-
1. Let |fieldValues| be the [=list=] containing the elements corresponding to the [=http/field-values=] of the <a>Vary</a> header.
3221
-
1. Let |isMatched| be true.
3222
-
1. For each |fieldValue| in |fieldValues|:
3223
-
1. If |fieldValue| matches "`*`", or the [=combined value=] given |fieldValue| and |cachedRequest|'s [=request/header list=] does not match the [=combined value=] given |fieldValue| and |request|'s [=request/header list=], then:
3224
-
1. Set |isMatched| to false.
3225
-
1. [=Break=].
3226
-
1. If |isMatched| is true, [=list/append=] |cachedRequest|/|cachedResponse| to |resultList|.
3206
+
1. Let |cachedRequest| be |requestResponse|'s request.
3207
+
1. Let |cachedResponse| be |requestResponse|'s response.
3208
+
1. If [=Request Matches Cached Item=] with |requestQuery|, |cachedRequest|, |cachedResponse|, and |options| returns true, then:
3209
+
1. Let |requestCopy| be a copy of |cachedRequest|.
3210
+
1. Let |responseCopy| be a copy of |cachedResponse|.
3211
+
1. Add |requestCopy|/|responseCopy| to |resultList|.
:: |response|, a [=/response=] or null, optional, defaulting to null
3222
+
:: |options|, a {{CacheQueryOptions}} object, optional
3223
+
: Output
3224
+
:: a boolean
3225
+
3226
+
1. If |options|.{{CacheQueryOptions/ignoreMethod}} is false and |request|'s [=request/method=] is not \``GET`\`, return false.
3227
+
1. Let |queryURL| be |requestQuery|'s [=request/url=].
3228
+
1. Let |cachedURL| be |request|'s [=request/url=].
3229
+
1. If |options|.{{CacheQueryOptions/ignoreSearch}} is true, then:
3230
+
1. Set |cachedURL|'s [=url/query=] to the empty string.
3231
+
1. Set |requestURL|'s [=url/query=] to the empty string.
3232
+
1. If |queryURL| does not [=url/equal=] |cachedURL| with the *exclude fragment flag* set, then return false.
3233
+
1. If |response| is null, |options|.{{CacheQueryOptions/ignoreVary}} is true, or |response|'s [=response/header list=] does not [=header list/contain=] \``Vary`\`, then return true.
3234
+
1. Let |fieldValues| be the [=list=] containing the elements corresponding to the [=http/field-values=] of the [=Vary=] header for the [=header/value=] of the [=header=] with [=header/name=] \``Vary`\`.
3235
+
1. For each |fieldValue| in |fieldValues|:
3236
+
1. If |fieldValue| matches "`*`", or the [=combined value=] given |fieldValue| and |request|'s [=request/header list=] does not match the [=combined value=] given |fieldValue| and |requestQuery|'s [=request/header list=], then return false.
<dfn method for="CacheStorage"><code>match(|request|, |options|)</code></dfn> method *must* run these steps:
1852
1855
1853
-
1. If |options|.{{CacheQueryOptions/cacheName}} is [=present=], then:
1856
+
1. If |options|.{{MultiCacheQueryOptions/cacheName}} is [=present=], then:
1854
1857
1. Return [=a new promise=] |promise| and run the following substeps [=in parallel=]:
1855
1858
1. [=map/For each=] |cacheName| → |cache| of the [=relevant name to cache map=]:
1856
-
1. If |options|.{{CacheQueryOptions/cacheName}} matches |cacheName|, then:
1859
+
1. If |options|.{{MultiCacheQueryOptions/cacheName}} matches |cacheName|, then:
1857
1860
1. Resolve |promise| with the result of running the algorithm specified in {{Cache/match(request, options)}} method of {{Cache}} interface with |request| and |options| (providing |cache| as thisArgument to the `[[Call]]` internal method of {{Cache/match(request, options)}}.)
1. If |options|.{{CacheQueryOptions/ignoreMethod}} is false and |request|'s [=request/method=] is not \`<code>GET</code>\`, return |resultList|.
3046
-
1. Let |cachedURL| and |requestURL| be null.
3047
3048
1. Let |storage| be null.
3048
3049
1. If the optional argument |targetStorage| is omitted, set |storage| to the [=relevant request response list=].
3049
3050
1. Else, set |storage| to |targetStorage|.
3050
3051
1. [=list/For each=] |requestResponse| of |storage|:
3051
-
1. Set |cachedURL| to |requestResponse|'s request's [=request/url=].
3052
-
1. Set |requestURL| to |request|'s [=request/url=].
3053
-
1. If |options|.{{CacheQueryOptions/ignoreSearch}} is true, then:
3054
-
1. Set |cachedURL|'s [=url/query=] to the empty string.
3055
-
1. Set |requestURL|'s [=url/query=] to the empty string.
3056
-
1. If |cachedURL| [=url/equals=] |requestURL| with the *exclude fragment flag* set, then:
3057
-
1. Add a copy of |requestResponse|'s request to |requests|.
3058
-
1. Add a copy of |requestResponse|'s response to |responses|.
3059
-
1. Let |index| be zero.
3060
-
1. For each |cachedResponse| in |responses|:
3061
-
1. Let |cachedRequest| be |requests|[|index|].
3062
-
1. Increment |index| by one.
3063
-
1. If |cachedResponse|'s [=response/header list=] contains no <a>header</a>[=header/named=] \`<code>Vary</code>\`, or |options|.{{CacheQueryOptions/ignoreVary}} is true, then:
3064
-
1. [=list/Append=] |cachedRequest|/|cachedResponse| to |resultList|.
3065
-
1. [=Continue=].
3066
-
1. Let |fieldValues| be the [=list=] containing the elements corresponding to the [=http/field-values=] of the <a>Vary</a> header.
3067
-
1. Let |isMatched| be true.
3068
-
1. For each |fieldValue| in |fieldValues|:
3069
-
1. If |fieldValue| matches "`*`", or the [=combined value=] given |fieldValue| and |cachedRequest|'s [=request/header list=] does not match the [=combined value=] given |fieldValue| and |request|'s [=request/header list=], then:
3070
-
1. Set |isMatched| to false.
3071
-
1. [=Break=].
3072
-
1. If |isMatched| is true, [=list/append=] |cachedRequest|/|cachedResponse| to |resultList|.
3052
+
1. Let |cachedRequest| be |requestResponse|'s request.
3053
+
1. Let |cachedResponse| be |requestResponse|'s response.
3054
+
1. If [=Request Matches Cached Item=] with |requestQuery|, |cachedRequest|, |cachedResponse|, and |options| returns true, then:
3055
+
1. Let |requestCopy| be a copy of |cachedRequest|.
3056
+
1. Let |responseCopy| be a copy of |cachedResponse|.
3057
+
1. Add |requestCopy|/|responseCopy| to |resultList|.
:: |response|, a [=/response=] or null, optional, defaulting to null
3068
+
:: |options|, a {{CacheQueryOptions}} object, optional
3069
+
: Output
3070
+
:: a boolean
3071
+
3072
+
1. If |options|.{{CacheQueryOptions/ignoreMethod}} is false and |request|'s [=request/method=] is not \``GET`\`, return false.
3073
+
1. Let |queryURL| be |requestQuery|'s [=request/url=].
3074
+
1. Let |cachedURL| be |request|'s [=request/url=].
3075
+
1. If |options|.{{CacheQueryOptions/ignoreSearch}} is true, then:
3076
+
1. Set |cachedURL|'s [=url/query=] to the empty string.
3077
+
1. Set |requestURL|'s [=url/query=] to the empty string.
3078
+
1. If |queryURL| does not [=url/equal=] |cachedURL| with the *exclude fragment flag* set, then return false.
3079
+
1. If |response| is null, |options|.{{CacheQueryOptions/ignoreVary}} is true, or |response|'s [=response/header list=] does not [=header list/contain=] \``Vary`\`, then return true.
3080
+
1. Let |fieldValues| be the [=list=] containing the elements corresponding to the [=http/field-values=] of the [=Vary=] header for the [=header/value=] of the [=header=] with [=header/name=] \``Vary`\`.
3081
+
1. For each |fieldValue| in |fieldValues|:
3082
+
1. If |fieldValue| matches "`*`", or the [=combined value=] given |fieldValue| and |request|'s [=request/header list=] does not match the [=combined value=] given |fieldValue| and |requestQuery|'s [=request/header list=], then return false.
0 commit comments