Skip to content

Commit

Permalink
docs: update workbox
Browse files Browse the repository at this point in the history
  • Loading branch information
pooya parsa committed May 7, 2019
1 parent e377436 commit 913897a
Showing 1 changed file with 20 additions and 15 deletions.
35 changes: 20 additions & 15 deletions docs/modules/workbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

<!-- General -->
Expand Down Expand Up @@ -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`)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 913897a

Please sign in to comment.