Commit Graph

12 Commits

Author SHA1 Message Date
George Kalpakas 8f120aff33 refactor(service-worker): DRY up SW registration logic (#21842)
PR Close #21842
2019-04-25 12:29:58 -07:00
JiaLi.Passion 4cfba58072 feat(service-worker): allow configuring when the SW is registered (#21842)
Fixes #20970

PR Close #21842
2019-04-25 12:29:58 -07:00
Jun 009acd2a6c docs(service-worker): add info about no network request for performance strategy (#29288)
PR Close #29288
2019-03-29 10:28:46 -07:00
Cyrille Tuzi 59f64dd361 docs(service-worker): update service worker configuration doc (#27868)
PR Close #27868
2019-01-03 09:27:30 -08:00
nazanin1369 84af7b065d docs(service-worker): Specify format of datagroups.cacheConfig.timeout (#26469)
Fixes #26454

PR Close #26469
2018-10-23 08:58:17 -07:00
jenniferfell 0ef1f7ef0d docs: change links to cli wiki to link to new aio docs files m to z (#26492)
PR Close #26492
2018-10-17 11:06:07 -07:00
George Kalpakas 250527ca68 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
2018-07-06 13:50:17 -07:00
George Kalpakas 1d378e2987 fix(service-worker): deprecate `versionedFiles` in asset-group resources (#23584)
Since `versionedFiles` behaves in the exact same way as `files`, there
is no reaason to have both. Users should use `files` instead.

This commit deprecates the property and prints a warning when coming
across an asset-group that uses it. It should be completely removed in
a future version.

Note, it has also been removed from the default `ngsw-config.json`
template in angular/devkit#754.

PR Close #23584
2018-05-15 12:19:08 -07:00
George Kalpakas 08325aaffc feat(service-worker): add support for configuring navigations URLs (#23339)
The ServiceWorker will redirect navigation requests that don't match any
`asset` or `data` group to the specified index file. The rules for a
request to be classified as a navigation request are as follows:
1. Its `mode` must be `navigation`.
2. It must accept a `text/html` response.
3. Its URL must match certain criteria (see below).

By default, a navigation request can have any URL except for:
1. URLs containing `__`.
2. URLs to files (i.e. containing a file extension in the last path
   segment).

While these rules are fine in many cases, sometimes it is desirable to
configure different rules for the URLs of navigation requests (e.g.
ignore specific URLs and pass them through to the server).

This commit adds support for specifying an optional `navigationUrls`
list in `ngsw-config.json`, which contains URLs or simple globs
(currently only recognizing `!`, `*` and `**`).
Only requests whose URLs match any of the positive URLs/patterns and
none of the negative ones (i.e. URLs/patterns starting with `!`) will be
considered navigation requests (and handled accordingly by the SW).

(This is an alternative implementation to #23025.)

Fixes #20404

PR Close #23339
2018-04-13 13:13:36 -07:00
George Kalpakas d1e716b2cb docs(service-worker): minor fixes/improvements (#23339)
PR Close #23339
2018-04-13 13:13:36 -07:00
Vani 1ce46b56f8 docs: change titles to sentence case (#21620)
PR Close #21620
2018-01-18 18:22:09 -06:00
chembu f593552cfe docs(aio): Rename service worker files, update examples, move service worker under Techniques 2017-12-19 11:07:57 -08:00