Zero-Downtime Private Release Proxy Caching for Desktop Auto-Updaters
What happens when 30,000 Mac and Electron apps poll latest-mac.yml and appcast.xml after a viral launch — and how to combine in-memory LRU singleflight caching with exact byte-range binary streaming.
Auto-updaters have a deceptive traffic profile. During quiet weeks, your server sees steady background polls every 4–24 hours. Then your app hits the front page of Hacker News or you ship a major update — suddenly tens of thousands of desktop apps hit latest-mac.yml, appcast.xml, and RELEASES in a burst.
If every manifest request makes an authenticated GitHub API call to look up the release tag and fetch the asset, you will blow past GitHub's 5,000 requests/hour API quota in minutes and every client sees HTTP 503.
1. Strictly separate tiny manifests from large binary installers
Never apply the same HTTP handler or buffering strategy to a 1.5 KB YAML manifest and a 140 MB .dmg/.zip binary. Treat them as two completely distinct data paths:
| Asset Class | Size | Caching Strategy | HTTP Framing Rules |
|---|---|---|---|
| Updater Manifests (latest-mac.yml, appcast.xml, RELEASES) | 1 KB – 64 KB | Bounded in-memory LRU (<= 256 KB cap) + singleflight deduplication | Emit X-ReleaseFlow-Cache: HIT/MISS; bypass cache on Range requests |
| Release Binaries (.dmg, .zip, .exe, .AppImage) | 15 MB – 300 MB | Never buffer in RAM; stream straight from direct GitHub asset apiUrl | Preserve exact Content-Length, Accept-Ranges: bytes, 206 Partial Content, identity encoding |
2. Eliminate thundering herds with singleflight coalescing
An LRU cache alone does not save you when a hot entry expires: if 50 clients arrive during the 180 ms window while the cache is cold, all 50 miss simultaneously and fire 50 redundant upstream fetches. Wrapping the cache fill in a singleflight map keyed by (appId, releaseVersion, updatedAt, fileName) collapses all 50 concurrent requests into 1 upstream call.
# 1. Verify cached manifest serves 200 with cache status header
curl -sI https://releaseflow.net/kitze/sizzy/updates/mac/latest-mac.yml | \
grep -iE "^(http/|content-type|x-releaseflow-cache)"
# 2. Verify binary download preserves exact Content-Length + Accept-Ranges
curl -sI https://releaseflow.net/kitze/sotto/download/mac3. Keying cache entries by release updatedAt for instant rollbacks
Include the release's updatedAt timestamp in the cache key and explicitly invalidate the app's cache prefix whenever a release is synced, disabled, or toggled in the dashboard. That way, disabling a buggy build flips every desktop client back to the previous healthy release on the very next poll — zero stale CDN limbo.
Ship your Mac or Electron app with a single git tag.
Permanent OS-aware download links, cached Sparkle & Electron auto-update feeds, Polar/Stripe PPP checkout, and license keys — with 0% cut on your sales.