Does cache rules works with workers?
I've build worker based svelte app. I wanted to cache my data for 8hours (content is really changed). I set up rules cache everyhting (frist screenshot). Then in worker observability logs i see multiple request for
GET / which are served within same - small amount of time (screenshot nr 2), why is that? Does cache rules works with workers ?

7 Replies
Workers run in front of cache, you have to use the cache api in workers to use cache: https://developers.cloudflare.com/workers/runtime-apis/cache/
which only makes sense for some cases like if your endpoint depends on external data, if it's generated internally, probably faster to just not
Ok, I see. So if for example I would like to optimize costs by cashing responses on the edge I cannot?
Your worker would always run yea, even using the cache api you can't avoid the invocation
I see, thanks
@Chaika WAF rules like rate limiting is working properly with worker right?
with workers on custom domains? yup
yup thx