© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Cloudflare DevelopersCD
Cloudflare Developers•2y ago•
4 replies
FabulousFox

Cache worker result

I have a worker that returns some bundled API data as a stringified json object for use in my website that is quite costly in the background. I therefore need this worker's result to be cached for about 6 hours. I set up the worker to be only accessible through data.mydomain.com and set up a cache rule on the website with the filter '(http.host eq "data.mydomain.de")', with the settings 'Eligible for cache', 'Ignore cache-control header and use this TTL' and a TTL of 5 hours. This should work because cache rules are applied before workers (I think). However, after some testing, I noticed the data was not cached at all (Luckily it was providing demo data). How can i force this worker url route to be cached?
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

Using cache in worker
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
3y ago
Bypassing cache from worker fetch
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
10mo ago
cache worker request not working?
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
16mo ago
How to cache worker response?
Cloudflare DevelopersCDCloudflare Developers / workers-and-pages-help
2y ago