OverviewFilesCommitsIssuesDocsReleasesPeers

terrain-lookdev commits / caba524

lookdev: never cache index.html
A cached page is not cosmetic here. The pre-fix index.html sent the seed field on every request, so a browser holding it kept driving the world to a different seed while the server was verifiably on 1234 and every server-side check said the output was bit-identical to the first image of the session. The fix was ctrl-shift-R, which nothing on my side could have told me. no-store on the page, since it changes many times per session. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
caba52413976fb7fde872bcda5981f07c7a2c0f2
by plankatron <noreply@anthropic.com> · 2026-08-31T18:43:22.000Z

Changed files (1) +9 -1

server.py +9 -1
……@@ -312,7 +312,15 @@ def stats_headers(resp, h, lo, hi, extra=None):
312312# ---------------------------------------------------------------------------
313313@app.get("/")
314314def index():
315 return send_from_directory(HERE, "index.html")
315 # The page is edited constantly during a session, and a cached copy is not a
316 # cosmetic problem: an older index.html kept sending the seed field on every
317 # request, so the browser silently drove the world to a different seed while
318 # the server was verifiably on 1234. Cost an hour of chasing a model bug that
319 # did not exist. Never let this file cache.
320 r = send_from_directory(HERE, "index.html")
321 r.headers["Cache-Control"] = "no-store, no-cache, must-revalidate, max-age=0"
322 r.headers["Pragma"] = "no-cache"
323 return r
316324
317325
318326@app.get("/api/erosion.png")