fix(server): Cache-Control no-cache for web assets (stop stale builds) #99
Reference in New Issue
Block a user
Delete Branch "fix/web-no-cache-headers"
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?
Returning players kept seeing stale builds after a deploy. The origin serves the new files (verified 8/8 cache-busted), but the server sends no Cache-Control on the web router, so browsers heuristically cache the
include_str!-compiled HTML and the fixed-name wasm-bindgen output (canvas.js,canvas_bg.wasm, …) indefinitely — even through a hard reload in Firefox.Adds
Cache-Control: no-cachein thesecurity_headersmiddleware (wraps the web router). Browsers revalidate before using a cached copy; ServeDir`s Last-Modified/ETag make unchanged assets a cheap 304, changed ones re-fetch. Fixes the recurring stale-build problem.Note: this is the delivery fix. The actual wgpu 2048 canvas fix (#98) is already deployed and confirmed live at the origin; it just needs Rhys on a fresh (uncached) load to verify it renders.
🤖 Generated with Claude Code