diff --git a/public/sw.js b/public/sw.js index 3ee335e..f674517 100644 --- a/public/sw.js +++ b/public/sw.js @@ -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({