From cb5c8db2c631d8a8984c980d351f44f12ade6b2c Mon Sep 17 00:00:00 2001 From: martbost Date: Tue, 8 Sep 2026 12:02:05 -0500 Subject: [PATCH] Never cache HTML (no-store) so wallet browsers can't serve stale pages Trust's in-app browser was serving a cached pre-fix HTML page that pointed at old JS, re-triggering the numeric-chainId crash even after the fix shipped. Switch HTML from no-cache to no-store so every load fetches the current page and its current asset versions. Versioned assets still cache for an hour. Co-Authored-By: Claude Opus 4.8 --- server.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server.js b/server.js index abbf431..2593535 100644 --- a/server.js +++ b/server.js @@ -177,7 +177,10 @@ function sendFile(res, file) { if (err) { res.writeHead(404, baseHeaders({ 'Content-Type': 'text/plain' })); return res.end('Not found'); } const ext = path.extname(file).toLowerCase(); res.writeHead(200, baseHeaders({ 'Content-Type': MIME[ext] || 'application/octet-stream', - 'Cache-Control': ext === '.html' ? 'no-cache' : 'public, max-age=3600' })); + // HTML is never stored (so a fresh load always gets the current asset + // versions — aggressive in-app wallet browsers were serving stale pages + // that pointed at old, since-fixed JS); versioned assets cache for an hour. + 'Cache-Control': ext === '.html' ? 'no-store, must-revalidate' : 'public, max-age=3600' })); res.end(data); }); }