fix: make browsers revalidate pages, scripts and styles #9

Merged
rcsheets merged 1 commit from fix/revalidate-pages into main 2026-10-25 00:23:56 +00:00
Owner

Caddy served /, *.html, *.js and *.css with ETag and Last-Modified but no Cache-Control. Browsers therefore used heuristic freshness and could reuse a cached copy without asking. After #8, a returning visitor could get the new index.html with the old main.js. The old script has no /oauth2/userinfo probe, so Log In stayed visible after a successful sign-in. The oauth2-proxy logs from the first real login show AuthSuccess, then no userinfo request at all.

These paths now carry Cache-Control: no-cache. Browsers still cache them but revalidate on every load, which costs a 304 when the file is unchanged. Images and the sensor JSON are unchanged.

Verification

The new Caddyfile was run under caddy:2.11.7-alpine with site/ mounted: no-cache on /, /main.js, /style.css and /email.html, nothing added on images, and If-None-Match returns 304. The full image build was not run locally, because the setcap step fails under rootless podman.

🤖 Generated with Claude Code

Caddy served `/`, `*.html`, `*.js` and `*.css` with `ETag` and `Last-Modified` but no `Cache-Control`. Browsers therefore used heuristic freshness and could reuse a cached copy without asking. After #8, a returning visitor could get the new `index.html` with the old `main.js`. The old script has no `/oauth2/userinfo` probe, so Log In stayed visible after a successful sign-in. The oauth2-proxy logs from the first real login show `AuthSuccess`, then no userinfo request at all. These paths now carry `Cache-Control: no-cache`. Browsers still cache them but revalidate on every load, which costs a 304 when the file is unchanged. Images and the sensor JSON are unchanged. ## Verification The new Caddyfile was run under `caddy:2.11.7-alpine` with `site/` mounted: `no-cache` on `/`, `/main.js`, `/style.css` and `/email.html`, nothing added on images, and `If-None-Match` returns 304. The full image build was not run locally, because the `setcap` step fails under rootless podman. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Caddy sent no Cache-Control, so browsers applied heuristic freshness
and could run a cached old main.js against a new index.html. After
the login release that meant no /oauth2/userinfo probe and a Log In
button that stayed after signing in.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
rcsheets deleted branch fix/revalidate-pages 2026-10-25 00:23:56 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
brooktrails/brooktrails-web!9
No description provided.