Disable origin cache headers to prevent stale JS/WASM mismatch

static-web-server's default cache-control sends max-age=31536000 (1 year)
for .js files but only 1 day for .wasm. After redeployment, Cloudflare CDN
serves the cached old .js with a fresh .wasm, causing EM_ASM address table
mismatches and runtime crashes. Disable built-in cache headers at the origin
so Cloudflare respects new content on each deploy.

Also update AGENTS.md: add deploy commands, fix emsdk path, document the
Cloudflare cache-purge requirement, and correct stale MAX_ENTITY_SPAWNS
and MAX_EXIT_ZONES values.
This commit is contained in:
Thomas
2026-03-02 21:33:07 +00:00
parent b3055f4bd3
commit 6b32199f25
2 changed files with 15 additions and 3 deletions

View File

@@ -18,3 +18,9 @@
FROM docker.io/joseluisq/static-web-server:2
COPY dist-web/ /public/
# Disable the default cache-control headers which cache .js for 1 year.
# The .js and .wasm files must always be fetched together (EM_ASM address
# table in JS must match the compiled WASM), so aggressive caching causes
# "No EM_ASM constant found" errors after redeployments.
ENV SERVER_CACHE_CONTROL_HEADERS=false