Files
darkshy.bronyfurry.com/js/pwabuilder-sw.js
2023-01-14 02:25:00 +03:00

18 lines
444 B
JavaScript

// This is the "Offline copy of pages" service worker
const CACHE = "darkshy-offline";
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.StaleWhileRevalidate({
cacheName: CACHE
})
);