fix: make browsers revalidate pages, scripts and styles #9
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/revalidate-pages"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Caddy served
/,*.html,*.jsand*.csswithETagandLast-Modifiedbut noCache-Control. Browsers therefore used heuristic freshness and could reuse a cached copy without asking. After #8, a returning visitor could get the newindex.htmlwith the oldmain.js. The old script has no/oauth2/userinfoprobe, so Log In stayed visible after a successful sign-in. The oauth2-proxy logs from the first real login showAuthSuccess, 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-alpinewithsite/mounted:no-cacheon/,/main.js,/style.cssand/email.html, nothing added on images, andIf-None-Matchreturns 304. The full image build was not run locally, because thesetcapstep fails under rootless podman.🤖 Generated with Claude Code