R2 Caching

I didn’t find a setting doc for R2 caching. I am planning to start using R2 with custom domain name, how the caching will enabled? also if I set the TTL to 1 year is that mean each file will get called only once from R2?

You can use Cache Rules like normal (even for a public domain for your R2 bucket).

As far as how often it will be fetched, edge cache isn’t persistent, nor guaranteed, so if it’s a low traffic item, it could be evicted from the edge cache and the next request will go back to the origin. R2 doesn’t work with tiered cached either, so it’s potentially a request to the origin for each request coming from a unique PoP. In this context, the origin is the R2 servers, which would work out to 1 class B operation every time the request for an object goes there.

1 Like

Thanks @digitalpoint that was helpful.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.