Cloudflare Workers .NET / cache api
worker check deferred

Cache key

The full request URL is the cache key, so two different keys are cached independently. Change the key and the sample starts with a miss again.

Press β€œRequest” twice to watch x-cache flip from miss to hit.

Result

No call yet. Send a GET request to generate and store the entry.

What the worker does

1. Match
cache.MatchAsync(url)
β†’
2. Hit
stored response replayed
β†’
3. Miss, build and store
context.WaitUntil(cache.PutAsync(…))
β†’
4. Purge
cache.DeleteAsync(url)

The stored copy carries cache-control: max-age=300; without it the Cache API quietly refuses to keep the response. The copy sent to this browser carries cache-control: no-store, so every click really reaches the worker and the hit/miss flip stays visible.

Calls made from this page

No calls yet.

An unhandled error has occurred. Reload πŸ—™