Cloudflare R2 is an S3-compatible object storage service with zero egress fees, making it compelling for high-traffic applications. Understanding bucket access patterns, Worker bindings, presigned URLs, and public domain setup is essential for integrating R2 effectively.
0 / 5 completed
1 / 5
What is the most commercially significant difference between Cloudflare R2 and Amazon S3 for high-egress workloads?
R2's zero egress fees are its defining advantage. S3 can charge $0.09/GB or more for outbound data transfer. For applications that serve large amounts of data (video, large files, ML datasets), R2 eliminates what is often the largest storage-related line item.
2 / 5
An existing application uses the AWS SDK with S3. What is the minimum change required to point it at Cloudflare R2?
R2 exposes an S3-compatible API. You only need to change the endpoint to your account's R2 URL (e.g., https://<accountid>.r2.cloudflarestorage.com) and substitute R2 API keys. All standard S3 operations (GetObject, PutObject, etc.) work without code changes.
3 / 5
In a Cloudflare Worker, how do you access an R2 bucket bound as MY_BUCKET?
R2 buckets are exposed to Workers through bindings. A bucket bound as MY_BUCKET is accessible as env.MY_BUCKET inside the Worker handler, providing an R2Bucket interface with get(), put(), delete(), and list() methods — no HTTP credentials needed.
4 / 5
What is a presigned URL in the context of R2 (via the S3-compatible API)?
A presigned URL is generated server-side by signing an S3/R2 request with your credentials and embedding the signature in the URL. It grants the bearer time-limited permission to perform a specific action (e.g., upload or download a specific object) without exposing your credentials.
5 / 5
You want objects in an R2 bucket to be publicly accessible via a custom domain. Which R2 feature enables this?
R2 supports public buckets with a connected custom domain. You enable public access in the dashboard and add a custom domain (a subdomain on your Cloudflare zone). Cloudflare then serves objects at https://your-domain.com/key with its CDN, zero-egress guarantee intact.