Edit ServiceWorker for DEV

sortierung
Samuel Zielke 1 year ago
parent faf738bce2
commit 07c88d9164

@ -2,16 +2,16 @@ var staticCacheName = "django-pwa-v" + new Date().getTime();
var filesToCache = [ var filesToCache = [
'/app/home', '/app/home',
]; ];
self.addEventListener("install", event => { // self.addEventListener("install", event => {
this.skipWaiting(); // this.skipWaiting();
event.waitUntil( // event.waitUntil(
caches.open(staticCacheName) // caches.open(staticCacheName)
.then(cache => { // .then(cache => {
return fetch('/app/home') // return fetch('/app/home')
.then(response => cache.put('/app/home', new Response(response.body))); // .then(response => cache.put('/app/home', new Response(response.body)));
}) // })
) // )
}); // });
// Clear cache on activate // Clear cache on activate
self.addEventListener('activate', event => { self.addEventListener('activate', event => {

Loading…
Cancel
Save

Powered by TurnKey Linux.