FabulousFox
CDCloudflare Developers
•Created by FabulousFox on 3/24/2024 in #workers-help
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?
5 replies