© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Cloudflare DevelopersCD
Cloudflare Developers•11mo ago
mzfrshk

Caching worker responses in Tiered Caching with Fetch API, similar to Cache API.

I have tiered caching enabled, so I cannot use the Cache API to save worker response while returning. What I can use is Fetch API, is there any way to save cache with Fetch API, similar to how we do with Cache API (caches.put). Basically, what I want to do is, cache the API response with Fetch.

Flow:
1. Example API: GET /employee
2. Call with GET /employee
3. If cache is present --> return from cache with HIT
4. If absent --> Cache with fetch API for subsequent API calls.
5. All of this should happen within the worker code.
6. The API call should not go into worker execution and should return from the Edge cache.

I have tried multiple ways. Can't seem to figure out the right way.
Cloudflare Developers banner
Cloudflare DevelopersJoin
Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news
85,042Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Workers fetch cache (tiered caching) - How to handle conditional caching?
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
3y ago
Caching R2 using worker cache api
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
3y ago
Does the Tiered Cache works for fetch with worker service bindings?
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
3y ago
Cache API usage in worker to cache POST requests.
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
16mo ago