Blog

Atomic Static Swaps on Cloudflare Workers

How this site ships HTML without a half-deployed middle state.

By Pouya GhourchianiGhourchiani

engineering

Direct answer

Build locally, validate, then upload a full asset set to Workers static assets so visitors never see a mixed old/new tree.

Practical shape

  1. npm run gate — typecheck/build/validate (includes AEO markdown mirrors)
  2. wrangler deploy — atomic-ish publish of the new asset manifest
  3. Soft-reload 404s: Worker strips If-None-Match before ASSETS rewrite; purge only if an old 404 was edge-cached

No nginx in this stack. Origin is Workers + Cloudflare DNS.