Commit 3734163b authored by James Fenn's avatar James Fenn
Browse files

add version number to cache names

parent 913db269
......@@ -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,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment