feat(service-worker): add support for ?
in SW config globbing (#24105)
The globbing is used in the following sections: - `assetGroups` > `resources` > `files`/`versionedFiles` - `assetGroups` > `resources` > `urls` - `dataGroups` > `urls` - `navigationUrls` Query params are ignored for `files`/`versionedFiles` and `navigationUrls`, but they are still taken into account for `assetGroups`/`dataGroups` `urls`. To avoid a breaking change, `?` is matched literally for these patterns. PR Close #24105
This commit is contained in:

committed by
Miško Hevery

parent
94076c934c
commit
250527ca68
@ -23,6 +23,7 @@ Unless otherwise noted, patterns use a limited glob format:
|
||||
|
||||
* `**` matches 0 or more path segments.
|
||||
* `*` matches 0 or more characters excluding `/`.
|
||||
* `?` matches exactly one character excluding `/`.
|
||||
* The `!` prefix marks the pattern as being negative, meaning that only files that don't match the pattern will be included.
|
||||
|
||||
Example patterns:
|
||||
@ -106,7 +107,7 @@ This section describes the resources to cache, broken up into three groups.
|
||||
* `versionedFiles` has been deprecated. As of v6 `versionedFiles` and `files` options have the same behavior. Use `files` instead.
|
||||
|
||||
* `urls` includes both URLs and URL patterns that will be matched at runtime. These resources are not fetched directly and do not have content hashes, but they will be cached according to their HTTP headers. This is most useful for CDNs such as the Google Fonts service.<br>
|
||||
_(Negative glob patterns are not supported.)_
|
||||
_(Negative glob patterns are not supported and `?` will be matched literally; i.e. it will not match any character other than `?`.)_
|
||||
|
||||
## `dataGroups`
|
||||
|
||||
@ -133,7 +134,7 @@ Similar to `assetGroups`, every data group has a `name` which uniquely identifie
|
||||
|
||||
### `urls`
|
||||
A list of URL patterns. URLs that match these patterns will be cached according to this data group's policy.<br>
|
||||
_(Negative glob patterns are not supported.)_
|
||||
_(Negative glob patterns are not supported and `?` will be matched literally; i.e. it will not match any character other than `?`.)_
|
||||
|
||||
### `version`
|
||||
Occasionally APIs change formats in a way that is not backward-compatible. A new version of the app may not be compatible with the old API format and thus may not be compatible with existing cached resources from that API.
|
||||
|
Reference in New Issue
Block a user