Browse Source

chore(sw.js): update CACHE_NAME to version 1.2.3 for better cache management and add self.clients.claim() to ensure the service worker takes control of the clients immediately after activation

Mathias 4 weeks ago
parent
commit
c0fb0c1bac
1 changed files with 3 additions and 1 deletions
  1. 3 1
      public/sw.js

+ 3 - 1
public/sw.js

@@ -1,4 +1,4 @@
-const CACHE_NAME = "workout-cool-v1";
+const CACHE_NAME = "1.2.3";
 const urlsToCache = [
 const urlsToCache = [
   "/",
   "/",
   "/manifest.json",
   "/manifest.json",
@@ -67,4 +67,6 @@ self.addEventListener("activate", (event) => {
       );
       );
     }),
     }),
   );
   );
+
+  self.clients.claim();
 });
 });