infra // stack
Edge caching and workers that keep global TTFB flat.
Surrogate-key cache tags let editors publish instantly while the edge serves stale-free HTML worldwide. Workers handle redirects, A/B variants, and geo logic without touching the origin.
Use for caching, redirects, and edge personalization; keep business logic in Rails.
why we use it
(01) Publish instantly, serve globally
Cache-tag purges invalidate exactly the pages an edit touches. Editors see changes live while the rest of the estate stays cached.
(02) Logic without origin load
Redirects, locale routing, and bot rules run in workers at the edge. Origins serve a fraction of the requests they used to.
(03) Budgets that survive traffic
Static Astro HTML plus edge caching means campaign spikes flatten at the CDN instead of autoscaling the database.
scope
(01) Surrogate-key cache tags with instant purges
(02) Edge workers for redirects, locales, and variants
(03) Globally flat TTFB independent of origin region
(04) WAF and bot rules ahead of application servers
tradeoffs
Our default versus the common alternative, stated honestly.
| dimension | 2sh | traditional |
|---|---|---|
| Latency | HTML served from the nearest edge point | Every visitor round-tripping to one origin region |
| Invalidation | Tag purges updating exactly the affected pages | Full-cache clears or stale content for hours |
| Scope | Edge for caching and routing, Rails for transactions | Business logic scattered across edge functions |
| When not workers | Stateful sessions and payments stay on the origin | Edge state that cannot be reasoned about |
Not sure Cloudflare Workers fits your estate?
In the audit we map your estate, model the cost of staying versus moving, and document the recommendation in writing.