Release Healer Man 0.1.32

This commit is contained in:
phenom committed 2026-09-12 11:07:25 -04:00
1 parent d3d6aaebdb
commit 6dcb1034e5
102 files changed
+10772 -788

No files matched your search

+10 -3
View File
@@ -1,4 +1,5 @@
const CONTENT_CACHE_NAME = "healer-man-content-v1";
const BOOTSTRAP_CACHE_NAME = "healer-man-bootstrap-v1";
const OBJECT_HEADER = "x-healer-man-content-object";
const ENCODING_HEADER = "x-healer-man-content-encoding";
let bundledManifest;
@@ -33,7 +34,13 @@ async function bundledAsset(path) {
const object = entry.download ?? entry;
// Older bootstrap catalogs served their original logical paths directly.
if (!object.url.startsWith("/content/bundled/")) return fetch(path);
const response = await fetch(object.url);
const bootstrapCache = await caches.open(BOOTSTRAP_CACHE_NAME);
const objectKey = new URL(object.url, self.location.origin).toString();
let response = await bootstrapCache.match(objectKey);
if (!response) {
response = await fetch(object.url);
if (response.ok) await bootstrapCache.put(objectKey, response.clone());
}
if (!response.ok) return response;
if (entry.download) return decodedResponse(response, path, entry.download.encoding);
return new Response(response.body, { headers: { "content-type": mimeType(path) } });
@@ -53,7 +60,6 @@ const BUNDLED_ASSET_PREFIXES = [
"/assets/characters/wow335a-v1/manifest.json",
"/assets/characters/wow335a-v1/human/",
"/assets/creatures/wailing-caverns/",
"/assets/game/arenas/",
"/assets/game/dungeons/wailing-caverns/",
];
const BUNDLED_ASSET_PATHS = new Set([
@@ -85,7 +91,8 @@ self.addEventListener("activate", (event) => {
event.waitUntil((async () => {
const names = await caches.keys();
await Promise.all(names
.filter((name) => name.startsWith(`${CONTENT_CACHE_NAME}-staging-`))
.filter((name) => name.startsWith(`${CONTENT_CACHE_NAME}-staging-`)
|| (name.startsWith("healer-man-bootstrap-") && name !== BOOTSTRAP_CACHE_NAME))
.map((name) => caches.delete(name)));
await self.clients.claim();
})());