diff --git a/status/assets/samipanel.png b/status/assets/samipanel.png index 934ad0e..fd7add6 100644 Binary files a/status/assets/samipanel.png and b/status/assets/samipanel.png differ diff --git a/status/build.js b/status/build.js index 6402589..9ab2af6 100644 --- a/status/build.js +++ b/status/build.js @@ -235,6 +235,15 @@ function updateServiceWorkerCache() { for (const name of Object.keys(bundles)) { hash.update(fs.readFileSync(path.join(DIST, name))); } + // DC-171-UX: assets participate in the cache tag too — an asset-only + // change (logo fix, icon swap) must bust the SW cache as well, otherwise + // runtime-cached images stay stale until the cache dies of old age. + const ASSET_EXTENSIONS = /\.(png|svg|ico|css|webmanifest)$/; + const assetDir = path.join(__dirname, 'assets'); + for (const f of fs.readdirSync(assetDir).filter((f) => ASSET_EXTENSIONS.test(f)).sort()) { + hash.update(f); + hash.update(fs.readFileSync(path.join(assetDir, f))); + } const tag = hash.digest('hex').slice(0, 10); const updated = sw.replace( /const CACHE = 'dashcaddy-shell-[^']+';/, diff --git a/status/sw.js b/status/sw.js index 7bcfdfe..24524b3 100644 --- a/status/sw.js +++ b/status/sw.js @@ -1,4 +1,4 @@ -const CACHE = 'dashcaddy-shell-7915de22e8'; +const CACHE = 'dashcaddy-shell-0fa5717320'; const PRECACHE = [ '/', '/index.html',