« All posts

Cloudflare Workers Cache: Layered Caching Built-in Before the Worker

Cloudflare announced Workers Cache, a tiered caching feature enabled with a single line of Wrangler configuration for Workers, reducing server-side rendering costs.

Cloudflare has launched Workers Cache, a tiered caching layer that sits in front of Workers and is enabled with a single Wrangler config block, controlled entirely through standard Cache-Control and Cache-Tag headers. On a cache hit the Worker doesn't run at all and incurs no CPU cost; on a miss the Worker executes and populates the cache, with purging handled programmatically via ctx.cache.purge() using tags.

The feature addresses a structural mismatch: Workers originally sat in front of an origin and a cache, but modern framework adapters (Astro, Next.js, Remix, SvelteKit) make the Worker itself the origin, leaving nothing to cache and forcing every request to execute code. Workers Cache flips this by placing the cache in front of the Worker instead.

A key technical piece is full support for stale-while-revalidate: expired cache entries are served instantly while the Worker refreshes them in the background, giving apps the speed of static sites with the freshness of server rendering, without framework-specific mechanisms like Incremental Static Regeneration. The system also supports content negotiation via Vary, multi-tenant-safe cache keys via ctx.props, and per-entrypoint cache control.

Workers Cache is available today to all Workers on any plan via Wrangler. For engineers, it substantially cuts server-render latency and compute cost while staying fully aligned with standard HTTP caching semantics, requiring no separate product or zone configuration.