Monorepo for Aesthetic.Computer aesthetic.computer

version: hold the poll open for forty-five seconds instead of four master

/api/version was 1,098,386 requests on 2026-09-09 — 57.0% of everything aesthetic.computer served that day — because disk.mjs starts a long-poll for the life of every non-preview tab and the server answered "nothing changed" after a flat 4s sleep. One open tab cost 21,600 requests a day to keep a badge up to date. The 4s sleep was a Netlify artifact: the old comment says re-checking "isn't useful (same function instance)". lith is one long-lived Express process, so re-reading .commit-ref mid-request does work. The hold is now 45s, ticking once a second, and it drops straight through to the full payload the moment the commit moves — so deploys are still detected within a second while the request count falls ~11x. Also caches the unmatched-hash branch for 15s. That branch shells out to `git fetch`, and every boot calls it once with no ?current, so a burst of boots was one fetch apiece; locally the second call now returns in 0ms instead of 2.5s. Server-side only, so it applies to tabs already running the old worker bundle. Verified against the handler directly: match holds the full window, a commit written mid-hold returns the new payload on the next tick, and an aborted client unwinds within one tick. Claude-Session: https://claude.ai/code/session_016Qtcrd9WiVLF3wrFL3wCSu


+50 -22
1 changed file