adam
CDCloudflare Developers
•Created by adam on 6/14/2024 in #general-help
How to cache R2 assets forever but not 404s?
I'm considering using R2 for a project for user uploads. I am testing it now and I created a bucket, made it public, and added a custom domain (because I wanted the CDN caching). I noticed the
Cache-Control
header wasn't that long. Ideally the assets would be cached forever / a year at least (aside from 404s). I've been playing around with "Cache rules" and I can't seem to get it right. Any ideas?3 replies