From 1968154ee801bceef0a35fe1d8848e1078806437 Mon Sep 17 00:00:00 2001 From: Gerrrt Date: Tue, 24 Nov 2026 15:53:38 -0800 Subject: [PATCH] fix(wall): serve the wall page's files with Cache-Control: no-cache heimdall's kiosk kept the old wall.js through a Chromium restart after the wall update deployed: Caddy sent no caching header, so Chromium reused its copy on a freshness it guessed from Last-Modified, and asked for routes that no longer exist. no-cache makes each load revalidate (a 304 when nothing changed), so the page's six-hourly reload picks up a change merged to main, as wall.js intends. Co-Authored-By: Claude Opus 5.5 --- docs/changelog.md | 10 ++++++++++ stacks/sensitive/Caddyfile | 7 +++++++ stacks/sensitive/README.md | 5 +++++ 3 files changed, 22 insertions(+) diff --git a/docs/changelog.md b/docs/changelog.md index dd33f3ea..05a0d1c4 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -19,6 +19,16 @@ docstring gives: it is a record, not a claim about now. ## 2026-11-24 +- **The wall page's files are served with `Cache-Control: no-cache`.** The + card-by-card review's changes, below, reached `trinity` at `c5374a15`, + but `heimdall`'s kiosk kept running the old `wall.js` through a Chromium + restart: it fetched neither the page nor the script, and asked for the + removed `/api/q/rtt`, `/api/ha/office_light` and `/api/ha/dogs`, each a + 404. Caddy sent no caching header, so Chromium kept its copy on a + freshness it guessed from the files' age. Deleting its `Cache_Data` and + restarting it loaded the new page, which then asked only for routes that + answer. Without the header, the page's six-hourly reload would not have + brought in a change either. - **The wall page changes after the operator's card-by-card review** ([ADR-0119](adr/0119-put-the-office-wall-dashboard-on-a-pi-5-on-hicks.md), `stacks/sensitive/README.md`, *The wall page*). Not yet deployed or seen diff --git a/stacks/sensitive/Caddyfile b/stacks/sensitive/Caddyfile index b99d0f7e..e8356451 100644 --- a/stacks/sensitive/Caddyfile +++ b/stacks/sensitive/Caddyfile @@ -559,7 +559,14 @@ wall.matrix.elysium { respond "no such question" 404 } + # The page, its script and its stylesheet. `no-cache` makes the + # browser ask before reusing its copy (a 304 when nothing changed). + # Without it Chromium guesses a freshness from Last-Modified, which + # for files weeks old is days: on 2026-11-24 heimdall's kiosk kept + # running the old wall.js through a restart, and only a cleared cache + # brought the new one. wall.js's six-hourly reload depends on this. handle { + header Cache-Control no-cache root * /srv/wall file_server } diff --git a/stacks/sensitive/README.md b/stacks/sensitive/README.md index 904362e6..345c274f 100644 --- a/stacks/sensitive/README.md +++ b/stacks/sensitive/README.md @@ -778,6 +778,11 @@ static files. - **It loads nothing from anywhere else.** The site's Content-Security-Policy allows only itself. There are no web fonts; the stacks fall back to the Pi's DejaVu. +- **A change reaches the screen by itself.** The page reloads every six + hours, and its files are served with `Cache-Control: no-cache`, so each + load asks Caddy whether they changed instead of trusting the browser's + copy. To see a change sooner, stop Chromium on `heimdall`; `lwrespawn` + starts it again a second later on a fresh load. - **Only what notifies counts.** The verdict and the alert list take `critical` and `warning` alerts only, as those are what Alertmanager delivers, the same rule the Glance *Estate* panel keeps. An `info` alert is