Cloudflare Docs
R2
Visit R2 on GitHub
Set theme to dark (⇧+D)

Data location

Learn how the location of data stored in R2 is determined and about the different available inputs that control the physical location where objects in your buckets are stored.

When you create a new bucket, the data location is set to Automatic by default. Currently, this option chooses a bucket location in the closest available region to the create bucket request based on the location of the caller.

​​ Location Hints

Location Hints are optional parameters you can provide during bucket creation to indicate the primary geographical location you expect data will be accessed from.

Using Location Hints can be a good choice when you expect the majority of access to data in a bucket to come from a different location than where the create bucket request originates. Keep in mind Location Hints are a best effort and not a guarantee, and they should only be used as a way to optimize performance by placing regularly updated content closer to users.

Currently, you can set the Location Hint via the LocationConstraint parameter using the S3 API:

await S3.send(
new CreateBucketCommand({
Bucket,
CreateBucketConfiguration: {
LocationConstraint: "WNAM",
},
})
);

Refer to Examples for additional examples of S3 SDKs.

​​ Available hints

The following hint locations are supported:

HintHint description
wnamWestern North America
enamEastern North America
weurWestern Europe
eeurEastern Europe
apacAsia-Pacific

​​ Current limitations

Location Hints are only honored the first time a bucket with a given name is created. If you delete and recreate a bucket with the same name, the original bucket’s location will be used.