Skip to content

Commit fccc2ba

Browse files
committed
Refresh PWA cache after UI fixes
1 parent f16ae7f commit fccc2ba

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

sw.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* 穿搭炼金屋 · Service Worker —— 离线可用的本地资源缓存 */
2-
const VERSION = "wearchemy-v7";
2+
const VERSION = "wearchemy-v9";
33
const SHELL = [
44
"./",
55
"./index.html",
@@ -17,7 +17,9 @@ const SHELL = [
1717

1818
self.addEventListener("install", (event) => {
1919
event.waitUntil(
20-
caches.open(VERSION).then((cache) => cache.addAll(SHELL)).then(() => self.skipWaiting())
20+
caches.open(VERSION)
21+
.then((cache) => cache.addAll(SHELL.map((url) => new Request(url, { cache: "reload" }))))
22+
.then(() => self.skipWaiting())
2123
);
2224
});
2325

0 commit comments

Comments
 (0)