Skip to content

Enable cache in an R2 bucket

To enable edge caching for a Cloudflare R2 bucket, make sure your bucket is public and accessible by the Cache. This can be done by creating a Custom Domain. Follow these steps to set up a Custom Domain for your bucket:

  1. Go to R2 and select your bucket.
  2. On the bucket page, select Settings.
  3. Under Public access > Custom Domains, select Connect Domain.
  4. Enter the domain name you want to connect to and select Continue.
  5. Review the new record that will be added to the DNS table and select Connect Domain.

This will generate a publicly available CNAME in the format [name].domain.com.

Additional considerations