exclude bundle from itself. add ability to force SW cache update

This commit is contained in:
Stewart Allen 2025-10-12 20:22:53 -04:00
commit 38a6ef8f03
5 changed files with 14 additions and 9 deletions

View file

@ -1,6 +1,6 @@
// --- configurable ---
const CACHE_VERSION = 'kiri-v001';
const BUNDLE_URL = '/kiri/bundle.bin';
const CACHE_VERSION = 'boot-v001';
const BUNDLE_URL = '/boot/bundle.bin';
const VERSION_KEY = '/__version__';
let mode = 'cached';
@ -36,8 +36,7 @@ async function ensureVersion(incomingVersion) {
log('no version stored → preload');
needPreload = true;
} else {
const text = await existing.text();
const stored = parseInt(text, 10);
const stored = await existing.text();
if (stored !== incomingVersion) {
log(`version mismatch ${stored} ≠ ${incomingVersion} → preload`);
needPreload = true;