Quickstart
Here is a practical example of caching a HTML page on the edge, but updating the content based on a query parameter.Updating a cache in middleware
Here is an example of updating a cache in middlewareRefresh and purge a cached value on demand
Expose a single URL that serves a cached JSON payload onGET, regenerates
it on POST, and clears it on DELETE. Useful for cache-warming endpoints,
manual invalidation hooks, or scheduled refreshes from an upstream job.
The POST handler awaits
cache.put() so the acknowledgement reflects that
the value actually landed. For fire-and-forget refreshes, wrap it with
Bunny.v1.waitUntil(cache.put(cacheKey, fresh.clone())) and return
the ack immediately.References
- Cache API overview — regional behavior, limitations, and API surface.
- Managing caches — the global
cachesobject and named cache instances. - Reading & writing —
match,put,deletemethod reference. - Runtime: waitUntil — extend the isolate lifetime for background cache writes.