fix(diagnostic): no-store fuer index.html — Browser servierte alte Version

Die /-Response hatte keinen Cache-Control-Header. Der Browser cachte das
grosse Single-HTML-Dashboard heuristisch und servierte trotz (soft) Reload
die alte Inline-JS/CSS — neue Features (Projekte-verstecken-Button, Auge,
Token-Ersparnis-Card) tauchten erst nach Hard-Reload auf. Jetzt no-store +
no-cache, so dass jeder Load die frische Version bekommt.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-11 17:15:34 +02:00
co-authored by Claude Opus 4.8
parent bbfa1f73f6
commit 14bdd4dbf4
+10 -1
View File
@@ -1602,7 +1602,16 @@ const htmlPath = path.join(__dirname, "index.html");
const server = http.createServer((req, res) => { const server = http.createServer((req, res) => {
if (req.url === "/" || req.url === "/index.html") { if (req.url === "/" || req.url === "/index.html") {
res.writeHead(200, { "Content-Type": "text/html; charset=utf-8" }); // no-store: das Dashboard ist eine Single-HTML-App die bei jedem Deploy
// neue Inline-JS/CSS bekommt. Ohne Cache-Header servierte der Browser die
// alte Version trotz Reload (neue Features tauchten erst nach Hard-Reload
// auf) — genau das Symptom „ich seh den Button nicht".
res.writeHead(200, {
"Content-Type": "text/html; charset=utf-8",
"Cache-Control": "no-store, no-cache, must-revalidate",
"Pragma": "no-cache",
"Expires": "0",
});
res.end(fs.readFileSync(htmlPath, "utf-8")); res.end(fs.readFileSync(htmlPath, "utf-8"));
} else if (req.url === "/api/state") { } else if (req.url === "/api/state") {
res.writeHead(200, { "Content-Type": "application/json" }); res.writeHead(200, { "Content-Type": "application/json" });