test pwabuilder
parent
f794f5049d
commit
2c5adc30e2
|
@ -45,3 +45,23 @@ self.addEventListener('fetch', (event) => {
|
||||||
})());
|
})());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
// This is the service worker with the Cache-first network
|
||||||
|
|
||||||
|
const CACHE = "pwabuilder-precache";
|
||||||
|
|
||||||
|
importScripts('https://storage.googleapis.com/workbox-cdn/releases/5.1.2/workbox-sw.js');
|
||||||
|
|
||||||
|
self.addEventListener("message", (event) => {
|
||||||
|
if (event.data && event.data.type === "SKIP_WAITING") {
|
||||||
|
self.skipWaiting();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
workbox.routing.registerRoute(
|
||||||
|
new RegExp('/*'),
|
||||||
|
new workbox.strategies.CacheFirst({
|
||||||
|
cacheName: CACHE
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
Loading…
Reference in New Issue