From a427be9b6fa5938a017c9a55bc44e0af32985d09 Mon Sep 17 00:00:00 2001 From: sravan Date: Wed, 24 Jun 2026 17:58:23 +0530 Subject: [PATCH] fix(cache): send Cache-Control: no-store on all JSON/404 responses MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prevents a 404 (e.g. /manifest.json fetched before deploy) from being cached on a device and persisting after the file exists — the cause of the manifest 404 on mobile but not desktop. Co-Authored-By: Claude Opus 4.8 --- server/lib.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/lib.js b/server/lib.js index 330f6de..52a2d52 100644 --- a/server/lib.js +++ b/server/lib.js @@ -2,7 +2,9 @@ const now = () => Date.now(); const json = (res, code, body) => { - res.writeHead(code, { 'Content-Type': 'application/json' }); + // no-store: API/JSON responses (and 404s) must never be cached — a cached 404 for an asset + // like /manifest.json would otherwise persist on a device even after the file is deployed. + res.writeHead(code, { 'Content-Type': 'application/json', 'Cache-Control': 'no-store' }); res.end(JSON.stringify(body)); };