How to Cut CPU Costs with Cloudflare Workers Cache
You will learn how to configure Cloudflare Workers Cache to serve responses directly from entrypoints, handle invalidations, and partition cache keys.
Cloudflare’s new Workers Cache allows developers to serve cached HTTP responses directly from a Worker entrypoint without executing the underlying code. Released on July 6, 2026, this regionally tiered system replaces traditional zone-level CDN rules with a cache owned entirely by the Worker. Because cache hits skip the compute layer, this architecture significantly reduces latency and CPU billing for edge-heavy applications.
Workers Cache follows the Worker regardless of where it is invoked, operating seamlessly across workers.dev, custom domains, or service bindings. Here is how to configure it, manage cache lifecycles, and handle multi-tenant isolation.
Installation and Setup
Workers Cache requires Wrangler version 4.69.0 or higher. You enable the feature by adding a single configuration block to your wrangler.toml or wrangler.jsonc file.
toml name = “my-worker” main = “src/index.ts” compatibility_date = “2026-07-07”
[cache] enabled = true
Once enabled, the cache infrastructure automatically deploys a two-tier architecture. The lower tier caches data in the data center closest to the user, while the upper tier aggregates cache fills across regional data centers to maximize global hit rates.
Caching Logic and Headers
The cache behavior is controlled via standard HTTP RFC 9111 headers. Your Worker code dictates caching rules by returning specific headers in the HTTP response.
You control the cache duration and revalidation strategies using the Cache-Control header. Standard directives like max-age and stale-while-revalidate dictate how the upper and lower tiers hold the data. Content negotiation relies on the Vary header, allowing you to serve different cached responses based on incoming request properties.
Purging and Invalidation
Cloudflare supports two methods for invalidating cached responses.
For bulk operations, you can attach Cache-Tag headers to your responses. This allows you to group related assets and purge them simultaneously.
For granular, programmatic control, Workers Cache introduces a new invalidation API. A Worker can invalidate its own cache by calling ctx.cache.purge(), targeting specific tags or path prefixes. This is particularly useful when you need deterministic state updates after database mutations.
Multi-Tenant Safety and Composable Entrypoints
By default, cache keys are automatically scoped to the Worker version. This prevents unintentional data pollution across deployments.
For multi-tenant applications, you can further partition cache keys using ctx.props. This ensures strict data isolation between tenants, which is a critical requirement when you deploy Cloudflare Workers via temporary accounts for different enterprise clients.
The feature also enables composable entrypoints. A “gateway” Worker can handle authentication and then fetch data from an internal “backend” entrypoint using ctx.exports. If the backend entrypoint response is cached, the gateway fulfills the request without triggering the heavy data operations. This pattern is highly efficient when you build real-time voice agents with Cloudflare Agents SDK, allowing you to cache static context while dynamic logic executes at the gateway.
Limits and Technical Specifications
Workers Cache is generally available for all Cloudflare customers across Free, Paid, and Enterprise plans. There is no additional cost for the cache itself; you pay the standard request rates and save on CPU time for every cache hit.
| Specification | Value |
|---|---|
| Minimum Wrangler Version | 4.69.0 |
| Max Response Body Size | 512 MB |
| Protocol Standard | HTTP RFC 9111 |
| Key Scope | Worker version (default) |
| Availability | General Availability (GA) |
Framework integration is actively expanding. Astro natively supports Workers Cache out of the box, with implementations for other major frameworks currently in progress.
Update your local Wrangler installation to version 4.69.0 and add the [cache] block to your active development environments to begin profiling CPU time savings.
Get Insanely Good at AI
The book for developers who want to understand how AI actually works. LLMs, prompt engineering, RAG, AI agents, and production systems.
Keep Reading
Browser Run Migrates to Edge Containers for 4x Concurrency
Cloudflare rebuilt its Browser Run platform on native edge containers, quadrupling concurrency limits and halving latency for automated web tasks.
Cloudflare Ships Panic and Abort Recovery for Rust Workers
Cloudflare updated Rust Workers to support WebAssembly exception handling, preventing isolated panics from crashing entire serverless instances.
Frozen MTP Drafters Yield 3x Gemini Nano Speedup on Pixel 10
Google has introduced frozen Multi-Token Prediction for Gemini Nano, utilizing lightweight drafter models to triple on-device inference speeds.
Multilingual PP-OCRv6 Beats GPT-5.5 on Industrial Text
PaddlePaddle's PP-OCRv6 system delivers 50-language text recognition in a 34.5M parameter footprint that outperforms massive vision models.
Cloudflare Rebuilds CLI on Vite Following VoidZero Acquisition
Cloudflare acquired VoidZero, bringing the Rust-based Vite build ecosystem internally to unify local development environments with global edge runtimes.