diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2020-04-30 15:23:02 -0400 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2020-04-30 15:23:02 -0400 |
| commit | 2bfefbdb7d4a36d20c8396943dde423d54ed548d (patch) | |
| tree | d5d596008eefa31c33b0e910b351039797bbf234 /static | |
| parent | 848f1ca425e03cdcf7503ab51d80711bbf28c0f2 (diff) | |
| download | personal-website-2bfefbdb7d4a36d20c8396943dde423d54ed548d.tar.gz personal-website-2bfefbdb7d4a36d20c8396943dde423d54ed548d.tar.bz2 personal-website-2bfefbdb7d4a36d20c8396943dde423d54ed548d.zip | |
Hopefully this works
Diffstat (limited to 'static')
| -rw-r--r-- | static/sw.js | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/static/sw.js b/static/sw.js index ea69899..3f26afe 100644 --- a/static/sw.js +++ b/static/sw.js @@ -1 +1,32 @@ -// THIS FILE SHOULD NOT BE VERSION CONTROLLED +importScripts('https://cdn.jsdelivr.net/npm/workbox-cdn@4.3.1/workbox/workbox-sw.js') + +// -------------------------------------------------- +// Configure +// -------------------------------------------------- + +// Set workbox config +workbox.setConfig({ + "debug": false +}) + +// Start controlling any existing clients as soon as it activates +workbox.core.clientsClaim() + +// Skip over the SW waiting lifecycle stage +workbox.core.skipWaiting() + +workbox.precaching.cleanupOutdatedCaches() + +// -------------------------------------------------- +// Precaches +// -------------------------------------------------- + +// Precache assets + +// -------------------------------------------------- +// Runtime Caching +// -------------------------------------------------- + +// Register route handlers for runtimeCaching +workbox.routing.registerRoute(new RegExp('/_nuxt/'), new workbox.strategies.CacheFirst ({}), 'GET') +workbox.routing.registerRoute(new RegExp('/'), new workbox.strategies.NetworkFirst ({}), 'GET') |
