R2 caching vs workers caching
i want to serve foles from r2 is it saf3 to make r2 public ? does r2 do caching ? i read from https://discord.com/channels/595317990191398933/1146474564616990862/1146480498198200360 that even if you use caching it still hits the worker of that's the case i think r2 has 10 milion reads free so i can just give the r2 file url and use a r2 custom domain ?
1 Reply
If you were using a worker with an R2 binding and the cache api it would still be invocating the worker each time, yes.
If you're using R2 Custom Domains, you can use a Cache Rule, or upload the object with cache-control headers, and cache will work normally, and any cached reads will be free/not count as Class Bs to R2, and plus you wouldn't have the worker invocations to worry about