updated service worker.

This commit is contained in:
Michael Mainguy 2024-05-07 09:49:58 -05:00
parent 41aeceed69
commit 735bd4bb2f

View File

@ -1,6 +1,7 @@
importScripts('https://storage.googleapis.com/workbox-cdn/releases/7.1.0/workbox-sw.js');
const VERSION = '2';
const VERSION = '3';
const CACHE = "deepdiagram";
const IMAGEDELIVERY_CACHE = "deepdiagram-images";
// TODO: replace the following with the correct offline fallback page i.e.: const offlineFallbackPage = "offline.html";
const offlineFallbackPage = "/";
@ -27,6 +28,13 @@ workbox.routing.registerRoute(
cacheName: CACHE
})
);
workbox.routing.registerRoute(
new RegExp('.*imagedelivery.net.*'),
new workbox.strategies.CacheFirst({
cacheName: IMAGEDELIVERY_CACHE
})
);
workbox.routing.registerRoute(
new RegExp('/db/.*'),
new workbox.strategies.CacheFirst({