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?
3 Replies
coleretriever
coleretriever9mo ago
@FabulousFox any luck?
FabulousFox
FabulousFoxOP9mo ago
Its not possible. I solved it by simply embedding this data into my website and retriggering a build every day. (I retrigger the build using a GitHub Actions Cron Job calling a build trigger webhook)
coleretriever
coleretriever9mo ago
ahh, ok so was not really the same. I'm looking to cache api response data
Want results from more Discord servers?
Add your server