Created
February 27, 2019 22:43
-
-
Save webmaxru/fd6fc919bdc809310235198aa3778ee5 to your computer and use it in GitHub Desktop.
Workbox 4: workbox-window. Service worker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// For the simplicity let's use Workbox hosted on CDN | |
importScripts('https://storage.googleapis.com/workbox-cdn/releases/4.0.0/workbox-sw.js') | |
// Detailed logging is very useful during development | |
workbox.setConfig({debug: true}) | |
// Updating SW lifecycle to update the app after user triggered refresh | |
workbox.core.skipWaiting() | |
workbox.core.clientsClaim() | |
// We inject manifest here using "workbox-build" in workbox-build-inject.js | |
workbox.precaching.precacheAndRoute([]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment