Vibeleaderboard
← All Intel
Intel / blog

Your Worker can now have its own cache in front of it

Source
blog.cloudflare.com
Author
Cloudflare
Date

Context

Cloudflare's Workers Cache can return a saved response before the application code runs. A fresh cache hit avoids the Worker's CPU charge, although the standard request charge remains. For content that tolerates brief delays in updating, stale-while-revalidate can serve an older response while the Worker refreshes it in the background. The launch article explains these execution and billing rules.

Authentication still needs to run for every request. Cloudflare's documented pattern leaves a gateway uncached, verifies the user there, and passes a trusted user identifier to a cached backend. That identifier separates saved responses by user; it does not replace the access check.

Key quotes

“On a cache hit, your Worker doesn't run at all. Cloudflare returns the cached response and your CPU billing stays at zero.”

“Workers stopped being a thing you bolted onto an origin and started being the origin.”

“You get the speed of a static site without the build time, and the freshness of server rendering without the cost.”

“We don't know of another platform that gives you a cache that sits inside a single deployable unit, between the parts of your application, with each cache stage configured by the code on either side of it.”

Read the source blog.cloudflare.com
More from Cloudflare
Recommended reads
Comments

Checking sign-in…

Loading comments…