R2 storage

Finally I took the leap to integrate R2 bucket for the heck of experimentation. I considered S3 but settled on R2 because of simpler integration and reportedly better performance, and R2 will cost absolutely zero to me. I am also scheming to integrate it with Cache reserve at minimal expenses.

There was a slight hiccup, I cannot easily set the cache-control header for files in the R2 storage. As a result I cannot easily use the immutable property in the cache-control to implement cache busting with R2 storage. Plus, the R2 storage is accessed through its dedicated subdomain which means allowing CORS, which is a lot of configuration changes and a full extra hop due to the nature of CORS. The result was an overall poor performance. I ended up going back to square one and abandoning the whole idea of integrating with R2. But I am still experimenting with Cache Reserve.

The experiment concluded and I realized that I do not need Cache Reserve at all!