From 913897aecc8a64fa2728fa7983c0cd03b19109f0 Mon Sep 17 00:00:00 2001 From: pooya parsa Date: Tue, 7 May 2019 13:34:09 +0430 Subject: [PATCH] docs: update workbox --- docs/modules/workbox.md | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/docs/modules/workbox.md b/docs/modules/workbox.md index 2e1e56f4..42434a13 100644 --- a/docs/modules/workbox.md +++ b/docs/modules/workbox.md @@ -18,21 +18,6 @@ workbox: { } ``` -## Workbox Window - -This module uses [workbox-window](https://developers.google.com/web/tools/workbox/modules/workbox-window) to register and communicate with workbox service worker. -See docs for more information about use cases. - -As service worker is registered in background, to access instance you have to await on a promise: - -```js -const workbox = await window.$workbox - -if (workbox) { - // Service worker is available -} -``` - ## Options @@ -122,6 +107,10 @@ Workbox takes a lot of the heavy lifting out of precaching by simplifying the AP (Boolean) Cache all routes. Enabled by default. +### `offlineStrategy` + +(String) Strategy for caching routes. Default is `NetworkFirst`. + ### `offlinePage` (String) Enables routing all offline requests to the specified path. (Example: `/offline.html`) @@ -190,6 +179,22 @@ Default: `/(?!.*(__webpack_hmr|hot-update))` (String) Defaults to `/_nuxt`. + +## Workbox Window + +This module uses [workbox-window](https://developers.google.com/web/tools/workbox/modules/workbox-window) to register and communicate with workbox service worker. +See docs for more information about use cases. + +As service worker is registered in background, to access instance you have to await on a promise: + +```js +const workbox = await window.$workbox + +if (workbox) { + // Service worker is available +} +```s + ## Examples ### Adding custom runtimeCaching items (For CDN)