Created
March 10, 2019 20:16
-
-
Save camille-hdl/0f02f6be6f39f372c93d75300ba05a65 to your computer and use it in GitHub Desktop.
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
importScripts("https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js"); | |
workbox.precaching.suppressWarnings(); | |
// the following line will be replaced by workbox-cli | |
workbox.precaching.precacheAndRoute([]); | |
// Cache unpkg (for systemjs) | |
workbox.routing.registerRoute( | |
/^https:\/\/unpkg\.com/, | |
workbox.strategies.cacheFirst({ | |
cacheName: "unpkg", | |
plugins: [ | |
new workbox.cacheableResponse.Plugin({ | |
statuses: [0, 200], | |
}), | |
new workbox.expiration.Plugin({ | |
maxAgeSeconds: 60 * 60 * 24 * 365, | |
maxEntries: 30, | |
}), | |
], | |
}) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment