|
|
@@ -4,6 +4,8 @@ eleventyExcludeFromCollections: true |
|
|
|
--- |
|
|
|
importScripts('https://storage.googleapis.com/workbox-cdn/releases/3.6.1/workbox-sw.js'); |
|
|
|
|
|
|
|
const _version = '-1'; |
|
|
|
|
|
|
|
if (workbox) { |
|
|
|
workbox.precaching.precacheAndRoute([]); |
|
|
|
|
|
|
@@ -35,7 +37,7 @@ if (workbox) { |
|
|
|
// Cache CSS files |
|
|
|
/.*\.css/, |
|
|
|
workbox.strategies.staleWhileRevalidate({ |
|
|
|
cacheName: 'css-cache', |
|
|
|
cacheName: 'css-cache' + _version, |
|
|
|
}) |
|
|
|
); |
|
|
|
|
|
|
@@ -43,7 +45,7 @@ if (workbox) { |
|
|
|
// Cache image files |
|
|
|
/.*\.(?:png|jpg|jpeg|svg|gif)/, |
|
|
|
workbox.strategies.cacheFirst({ |
|
|
|
cacheName: 'image-cache', |
|
|
|
cacheName: 'image-cache' + _version, |
|
|
|
plugins: [ |
|
|
|
new workbox.expiration.Plugin({ |
|
|
|
maxEntries: 100, |
|
|
|