the "Browser Cache TTL" does nothing

i'm running a React Router 7 application, with the "assets" configuration key being used like this
[assets]
directory = "./build/client/"
[assets]
directory = "./build/client/"
so today the assets served are coming with max-age=0 i want them to be the maximum there is, 1 year, as all of those assets are fingerprinted I tried setting the "Browser Cache TTL" which effectively annunciates itself as the solution I need but when applied, I still get the max-age=0. What is going on? I've also tried to configure a rule to apply this. Didn't have any impact neither
No description
No description
No description
No description
3 Replies
niconiahi
niconiahiOP2mo ago
if possible, I don't want to set up a Worker that does this, as that would mean many many more incoming requests. Doesn't seem ideal at all
downeydabber
downeydabber2mo ago
I don't think you can do it directly, but this thread has some workarounds: https://community.cloudflare.com/t/setting-cache-headers-for-static-assets/720802
niconiahi
niconiahiOP2mo ago
thank you so so so much! not even Cloudflare people could point me in the right direction. You rock

Did you find this page helpful?