1 parent f16ae7f commit fccc2baCopy full SHA for fccc2ba
1 file changed
sw.js
@@ -1,5 +1,5 @@
1
/* 穿搭炼金屋 · Service Worker —— 离线可用的本地资源缓存 */
2
-const VERSION = "wearchemy-v7";
+const VERSION = "wearchemy-v9";
3
const SHELL = [
4
"./",
5
"./index.html",
@@ -17,7 +17,9 @@ const SHELL = [
17
18
self.addEventListener("install", (event) => {
19
event.waitUntil(
20
- caches.open(VERSION).then((cache) => cache.addAll(SHELL)).then(() => self.skipWaiting())
+ caches.open(VERSION)
21
+ .then((cache) => cache.addAll(SHELL.map((url) => new Request(url, { cache: "reload" }))))
22
+ .then(() => self.skipWaiting())
23
);
24
});
25
0 commit comments