docs(service-worker): update service worker configuration doc (#27868)

PR Close #27868
This commit is contained in:
Cyrille Tuzi 2018-12-30 14:56:44 +01:00 committed by Ben Lesh
parent 27431e0e1e
commit 59f64dd361
1 changed files with 5 additions and 1 deletions

View File

@ -90,6 +90,8 @@ The `installMode` determines how these resources are initially cached. The `inst
* `lazy` does not cache any of the resources up front. Instead, the Angular service worker only caches resources for which it receives requests. This is an on-demand caching mode. Resources that are never requested will not be cached. This is useful for things like images at different resolutions, so the service worker only caches the correct assets for the particular screen and orientation. * `lazy` does not cache any of the resources up front. Instead, the Angular service worker only caches resources for which it receives requests. This is an on-demand caching mode. Resources that are never requested will not be cached. This is useful for things like images at different resolutions, so the service worker only caches the correct assets for the particular screen and orientation.
Defaults to `prefetch`.
### `updateMode` ### `updateMode`
For resources already in the cache, the `updateMode` determines the caching behavior when a new version of the app is discovered. Any resources in the group that have changed since the previous version are updated in accordance with `updateMode`. For resources already in the cache, the `updateMode` determines the caching behavior when a new version of the app is discovered. Any resources in the group that have changed since the previous version are updated in accordance with `updateMode`.
@ -98,6 +100,8 @@ For resources already in the cache, the `updateMode` determines the caching beha
* `lazy` tells the service worker to not cache those resources. Instead, it treats them as unrequested and waits until they're requested again before updating them. An `updateMode` of `lazy` is only valid if the `installMode` is also `lazy`. * `lazy` tells the service worker to not cache those resources. Instead, it treats them as unrequested and waits until they're requested again before updating them. An `updateMode` of `lazy` is only valid if the `installMode` is also `lazy`.
Defaults to the value `installMode` is set to.
### `resources` ### `resources`
This section describes the resources to cache, broken up into three groups. This section describes the resources to cache, broken up into three groups.
@ -141,7 +145,7 @@ Occasionally APIs change formats in a way that is not backward-compatible. A new
`version` provides a mechanism to indicate that the resources being cached have been updated in a backwards-incompatible way, and that the old cache entries—those from previous versions—should be discarded. `version` provides a mechanism to indicate that the resources being cached have been updated in a backwards-incompatible way, and that the old cache entries—those from previous versions—should be discarded.
`version` is an integer field and defaults to `0`. `version` is an integer field and defaults to `1`.
### `cacheConfig` ### `cacheConfig`
This section defines the policy by which matching requests will be cached. This section defines the policy by which matching requests will be cached.