Case study
Edge Cache Layer
A distributed edge caching layer for web apps.
- #Edge
- #Caching
- #Performance
- #Serverless
Edge Cache Layer
A serverless edge caching solution that runs on 300+ POPs worldwide. Reduces latency by 70% on average and absorbs traffic spikes at the edge.
Why I built it
A client was paying $40k/month for a commercial CDN that could not cache their dynamic content. I built them a small edge worker that cached the cacheable parts and let the rest pass through. Cost dropped to $800/month. Latency dropped by 70%. They asked me to open-source it.
Features
- Runs on Cloudflare Workers, Vercel Edge, and Deno Deploy
- Stale-while-revalidate with configurable TTLs
- Tag-based invalidation — invalidate by content tag, not by URL
- Per-region analytics — see hit rates by region
- Zero-config cache key — sensible defaults, override when needed
What I learned
Caching is a correctness problem disguised as a performance problem. The hard part is not storing bytes at the edge — it is invalidating the right bytes at the right time. Tag-based invalidation was the unlock.