Skip to content

Commit

Permalink
docs(service-worker): add info about recovering from degraded Driver …
Browse files Browse the repository at this point in the history
…state

Related to angular#31865
  • Loading branch information
H--o-l committed Sep 14, 2019
1 parent 3a90a7c commit d9b2607
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions aio/content/guide/service-worker-devops.md
Expand Up @@ -207,6 +207,9 @@ There are two possible degraded states:
clean copy of the latest known version of the app. Older cached
versions are safe to use, so existing tabs continue to run from
cache, but new loads of the app will be served from the network.
The service worker will try to recover from that state when a new
version of the application is found, i.e. when a new `ngsw.json`
is available.

* `SAFE_MODE`: the service worker cannot guarantee the safety of
using cached data. Either an unexpected error occurred or all
Expand All @@ -216,6 +219,10 @@ network, running as little service worker code as possible.
In both cases, the parenthetical annotation provides the
error that caused the service worker to enter the degraded state.

Both states are temporary, as they are saved for the lifetime of ServiceWorker instance only.
ServiceWorkers are stopped by the browser after a certain period of inactivity and a new instance is created as soon as the ServiceWorker needs to handle an event (such as a request from the page).
Those new instances would start from the `NORMAL` mode.
An Angular update of the `ngsw-worker.js` script will also create a new instance and thus reset the Driver state.

#### Latest manifest hash

Expand Down

0 comments on commit d9b2607

Please sign in to comment.