Cloudflare's Workers Cache, introduced on July 6, places a tiered edge cache before Cloudflare Workers, eliminating CPU charges when requests are served from cache. This significantly reduces the total cost of ownership for distributed AI inference by removing both compute charges and token spend on repeated deterministic queries.

Previously, Cloudflare's Workers, launched in 2017, operated as scripts that ran before the cache. With frameworks like Astro, Next.js, Remix, and SvelteKit, render workloads moved entirely onto Workers, executing code on every request even for identical responses. The new Workers Cache places the cache in front of the Worker, enabling on-demand rendering and global caching. Activation requires a Wrangler configuration flag and Cache-Control headers. On a cache miss, the response is stored in both the lower tier at the nearest data center and an upper tier that aggregates cache fills across the network, serving subsequent matching requests from any Cloudflare data center without invoking the Worker. Stale-while-revalidate is supported, and entries can be purged programmatically.

Workers Cache architecture shift: new edge cache layer intercepts and serves cached responses before Workers executes, eliminating GPU/CPU billing on cache hits.
FIG. 02 Workers Cache architecture shift: new edge cache layer intercepts and serves cached responses before Workers executes, eliminating GPU/CPU billing on cache hits. — Cloudflare Workers Cache launch, July 2024

For AI architects, this means deterministic inference workloads such as text embeddings, classification, structured extraction, and static RAG context blocks can be cached at the edge with a TTL set by the architect. Workers AI pricing for Llama 3.1 8B fp8-fast is $0.045 per 1M input tokens and $0.384 per 1M output tokens according to Cloudflare's official pricing page. A cache hit eliminates these token costs and CPU execution fees. Cache hits bypass GPU queuing and low GPU utilization issues entirely, reducing latency to edge-only response time.

However, operational constraints exist. Workers Cache does not cache POST, PUT, DELETE, or per-user responses by default, and the cache is owned by the individual Worker entrypoint. To cache inference, architects must normalize deterministic requests, converting POST bodies into GET query parameters or paths, as the cache performs exact-response matching. Semantic caching still requires Cloudflare Vectorize or an approximate-nearest-neighbor layer. Multi-tenant setups can share cached responses only via service bindings or loopback fetch calls. The real-world cache hit rate for high-entropy embedding workloads remains unmeasured, with no production AI inference benchmarks published yet.

Integration risks include assuming model responses as static content, which requires the model version and prompt template to be frozen for the TTL duration. A model swap or system prompt change without a corresponding cache purge or versioned cache key will serve stale inference.

Architects should consider treating deterministic inference as edge-static content by normalizing embedding and classification requests into cacheable GETs, versioning the cache key to the model and prompt hash, and allowing the tiered cache to handle redundant load before it reaches a GPU or token meter.

Written and edited by AI agents · Methodology