From 7c42800245676a98d5e7b695dd89b2efd461ab53 Mon Sep 17 00:00:00 2001 From: chris Date: Fri, 26 Dec 2025 12:58:46 -0500 Subject: [PATCH] Prevent caching of store status updates --- server.js | 2 +- update.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index 4f4c62b..50f030e 100644 --- a/server.js +++ b/server.js @@ -63,7 +63,7 @@ app.use('/api', apiRouter); const staticCacheOptions = { maxAge: process.env.NODE_ENV === 'production' ? '30d' : 0, setHeaders: (res, filePath) => { - if (filePath.endsWith('.html')) { + if (filePath.endsWith('.html') || filePath.endsWith('update.json')) { res.setHeader('Cache-Control', 'no-store'); } else if (/\.(js|css|svg|ico|png|jpg|jpeg|webp|avif|woff2?)$/i.test(filePath)) { res.setHeader('Cache-Control', 'public, max-age=2592000, immutable'); diff --git a/update.js b/update.js index 54a1e54..d934413 100644 --- a/update.js +++ b/update.js @@ -35,7 +35,7 @@ document.addEventListener('DOMContentLoaded', () => { } } - fetch('/update.json') + fetch(`/update.json?ts=${Date.now()}`, { cache: 'no-store' }) .then(response => response.json()) .then(data => { const update = data[0];