How is R2 different than CF itself?

I got to play around a bit with R2 and I was wondering, deep down isn’t the R2 always available in CF? What I mean:

If I understand correctly R2 is build in order to allow developers host static files there, and then pull them directly through this bucket. Let’s say that I upload all the JavaScript files of my website to an R2 bucket and I load them directly from the bucket.

However if i create a rule that would edge cache the JavaScript files of my website for many days, won’t end up having the same result?


So R2 will actually store files, meaning you won’t need them elsehwere (such as a VPS or S3). For caching, they’d still need to be stored somewhere else, they can also be evicted from the cache at any time. If you don’t get many hits, it’ll definitely be removed well before that few-day TTL.

For a site though you may be interested in Pages over R2 -
It would offer much better performance, auto Git integration, and free unlimited requests!


I was mostly considering moving the JavaScript files of my web app from locally stored to be stored in CDN and this is how I came across R2!

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