test pwabuilder
This commit is contained in:
@@ -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
|
||||
})
|
||||
);
|
||||
|
Reference in New Issue
Block a user