From c5a9746bc1794cf3d7729263800a1859c0dab212 Mon Sep 17 00:00:00 2001 From: Oliver Rieger Date: Wed, 5 Aug 2026 07:47:27 +0200 Subject: [PATCH] Load the game once, not on every launch MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The cold-start complaints — late fonts, zombies missing from the stats screen — were one header. server.py sent no-cache, must-revalidate for everything, so a fresh launch revalidated ~230 sprites and three fonts before the game had a full set of frames. Assets under /assets now cache for a year when the URL carries ?v= (changing the file changes the URL, which is what SPRV is for) and a day when it does not; the fonts get a ?v= too. HTML and JS stay no-cache, so a deploy is still visible. Two client-side halves of the same report: a dropped sprite request used to be permanent for the session — the sheet stayed undefined and the zombie drew as some other design — so each one gets one retry. And the splash now holds its buttons back behind a loading bar until the last sheet has landed and both faces are ready, instead of letting you open the stats screen while half of it is still in flight. The bar is driven by setInterval, not rAF: rAF does not fire in a hidden tab, and an app that loads while backgrounded would come back to a frozen bar and a menu with no buttons on it. Co-Authored-By: Claude Opus 5 --- index.html | 28 +++++++++++++++++++++++----- main.js | 26 +++++++++++++++++++++++++- render.js | 25 +++++++++++++++++++------ server.py | 14 +++++++++++++- 4 files changed, 80 insertions(+), 13 deletions(-) diff --git a/index.html b/index.html index 7089c06..b33210c 100644 --- a/index.html +++ b/index.html @@ -15,16 +15,19 @@