Skip to content

Commit

Permalink
Update cache name
Browse files Browse the repository at this point in the history
  • Loading branch information
salbahra committed Sep 4, 2023
1 parent 67dfada commit fbcdc95
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion www/sw.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Define a name for the current cache
var cacheName = "OpenSprinkler-v1";
var cacheName = "OpenSprinkler-v2";

// List of files to be cached for offline use
var cacheFiles = [
Expand Down Expand Up @@ -107,6 +107,8 @@ var cacheFiles = [
"/css/images/icons-png/user-white.png",
"/css/images/icons-png/video-black.png",
"/css/images/icons-png/video-white.png",
"/js/analog.js",
"/js/apexcharts.min.js",
"/js/jquery.js",
"/js/jqm.js",
"/js/libs.js",
Expand Down Expand Up @@ -184,6 +186,7 @@ self.addEventListener("activate", (e) => {
caches.keys().then((keyList) => {
return Promise.all(keyList.map((key) => {
if (key !== cacheName) {
console.log("[Service Worker] Removing old cache: " + key);
return caches.delete(key);
}
}));
Expand Down

0 comments on commit fbcdc95

Please sign in to comment.