1 parent 482aa98 commit 9a8f1daCopy full SHA for 9a8f1da
1 file changed
public/sw.js
@@ -6,8 +6,8 @@ const urlsToCache = [
6
'/favicon.ico'
7
];
8
9
-// Install event - cache static assets
10
self.addEventListener('install', (event) => {
+ // skip waiting to activate new SW immediately and cache static assets
11
event.waitUntil(
12
caches.open(STATIC_CACHE)
13
.then((cache) => {
@@ -19,8 +19,8 @@ self.addEventListener('install', (event) => {
19
);
20
});
21
22
-// Activate event - clean up old caches
23
self.addEventListener('activate', (event) => {
+ // immediately take control of all pages and clean up old caches
24
25
caches.keys().then((cacheNames) => {
26
return Promise.all(
0 commit comments