How to cache workers with static assets (beta)?

I used to have my app deployed with pages I moved to the worker + assets beta so I can have access to logs. Unfortunately now my cache hit rate is zero. In my backend I do:
setResponseHeader(event, "Cache-Control", "max-age=60, stale-while-revalidate=60")

return response
setResponseHeader(event, "Cache-Control", "max-age=60, stale-while-revalidate=60")

return response
This used to work perfectly with pages, but is not working anymore with workers+static assets
No description
6 Replies
Hard@Work
Hard@Work2d ago
Are these for static or dynamic assets? For static assets, we recommend never caching them, as Pages/Assets does its own caching, which may break if you manually cache
Walshy
Walshy2d ago
your max-age is also a minute that'll pretty consistently not be in cache
cosbgn
cosbgnOP20h ago
it's dynamic (i.e. a backend function/worker) It's supposed to be a minute, but now it's just never cached
cosbgn
cosbgnOP20h ago
No description
cosbgn
cosbgnOP20h ago
on pages it was working perfectly, it changed since I moved to workers + assets
cosbgn
cosbgnOP20h ago
Response header is correctly set to: cache-control max-age=60, stale-while-revalidate=60
No description
Want results from more Discord servers?
Add your server