Skip to content

Commit 59f64dd

Browse files
cyrilletuzibenlesh
authored andcommitted
docs(service-worker): update service worker configuration doc (angular#27868)
PR Close angular#27868
1 parent 27431e0 commit 59f64dd

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎aio/content/guide/service-worker-config.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ The `installMode` determines how these resources are initially cached. The `inst
9090

9191
* `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.
9292

93+
Defaults to `prefetch`.
94+
9395
### `updateMode`
9496

9597
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
98100

99101
* `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`.
100102

103+
Defaults to the value `installMode` is set to.
104+
101105
### `resources`
102106

103107
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
141145

142146
`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.
143147

144-
`version` is an integer field and defaults to `0`.
148+
`version` is an integer field and defaults to `1`.
145149

146150
### `cacheConfig`
147151
This section defines the policy by which matching requests will be cached.

0 commit comments

Comments
 (0)