updated service worker.
This commit is contained in:
parent
41aeceed69
commit
735bd4bb2f
10
public/sw.js
10
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({
|
||||
|
||||
Loading…
Reference in New Issue
Block a user