Shipping web updates without asking players to clear their cache

We moved Arrow Puzzle to Cloudflare Workers, then fixed a stubborn problem: returning visitors seeing an old build after every deploy.

A web game has a problem that an app store version does not: you cannot make players update. Ship a fix, and anyone who played yesterday may keep running yesterday's build. This is the story of how we moved Arrow Puzzle's hosting and then stopped that from happening.

Moving to Cloudflare Workers

We retired our Firebase Hosting config and deployed the Flutter web build as static assets on Cloudflare Workers. Two settings matter. Unknown paths fall back to index.html, so deep links handled by our router keep working when someone opens or refreshes them. And files are served at their exact paths with no redirects, so store listings can keep linking to addresses such as the privacy policy page.

The stale build

Flutter's web output uses unhashed file names like main.dart.js. Our headers had marked those files as immutable for a year, which is perfect for hashed files and a trap for unhashed ones: browsers happily kept the old copy after a deploy, and players had to clear their cache to see a fix.

A real Arrow Puzzle browser tab running the latest build, checked against build_id.json on start and whenever the tab becomes visible
A real Arrow Puzzle browser tab running the latest build, checked against build_id.json on start and whenever the tab becomes visible

Step one: stop caching what changes

Every file is now served with no-cache. That does not mean no caching: the browser keeps a copy but must revalidate it with an ETag on each load. An unchanged file costs one quick 304 response, and a changed file arrives straight away. We also replaced the default bootstrap with a small custom one that drops the deprecated service worker registration, and it refreshes previously cached files once per browser to clear out entries stored under the old rules.

Step two: tell the tabs that are already open

A player who leaves a tab open all day never reloads. So every release build now gets a content fingerprint, written to a small build_id.json file. The page compares it on start-up and again whenever the tab becomes visible, and if it has changed it re-fetches the files and reloads. If no stamp is present it falls back to the earlier one-time refresh.

The deploy routine

The whole thing hides behind one script, tool/build_web.sh, which runs the release build and then stamps it. The rule is simple: every web deploy goes through that script, so nobody has to remember the second step.

What we learned

Caching bugs only show up for returning visitors, which is exactly who you do not test with. Treat unhashed file names and long cache lifetimes as a pair you must never combine.

Play the latest build at https://arrow-puzzle.nodevstudios.com.

More from the Arrow Puzzle devlog

All posts
21 November 2026Building a puzzle game with Flutter and RiverpodA look at how Arrow Puzzle is organised: logic kept apart from the UI, custom painters for the snakes, and a small, testable core.17 November 2026How we make sure every Arrow Puzzle level can be solvedA puzzle that cannot be solved is a bug. Here is how Arrow Puzzle generates dense, winding levels and verifies each one before it ships.15 November 2026A logo drawn in code, and a Home screen to matchArrow Puzzle's logo is not an image file. It is four game pieces and a wordmark painted by the same code that draws the board.