--- ---

Amazon S3 + CloudFront vs Cloudflare R2 Comparison

Presigned URLs Comparison

Feature Amazon S3 + CloudFront Cloudflare R2
Presigned URL Support ✅ Yes (S3 presigned URLs) ✅ Yes (S3-compatible)
Custom Expiry Time ✅ Yes ✅ Yes
CloudFront Signed URLs ✅ Yes (separate from S3) ❌ No
Authentication Method AWS Signature v4 S3-compatible signature

Caching Comparison

Feature Amazon S3 + CloudFront Cloudflare R2
Default Caching ❌ Only via CloudFront ✅ Built-in
CDN Integration ✅ CloudFront ✅ Cloudflare CDN
Cache Control Headers ✅ Supported ✅ Supported
Edge Caching ✅ CloudFront Edge Locations ✅ Cloudflare Global Network
Cache Purging ✅ $0.005 per path ✅ Free
Cache TTL Customization ✅ Configurable ✅ Via Cache-Control

Pricing Comparison

Cost Factor Amazon S3 + CloudFront Cloudflare R2
Storage Cost $0.023-$0.025/GB/month $0.015/GB/month
Egress Costs $0.085-$0.09/GB FREE
PUT/POST Requests $0.005/1,000 requests $0.36/1M requests
GET Requests $0.0004/1,000 requests $0.15/1M requests
CDN Costs $0.085/GB + additional fees Built-in (Free)
Cache Purging $0.005 per path Free

Cost Scenarios

1TB Storage + 500GB Downloads

Scenario 1: Small Business (1TB Storage + 500GB Downloads)

Service Storage Cost Egress Cost Request Costs* Total Monthly
S3 + CloudFront $23 $42.50 ~$5 ~$70.50
Cloudflare R2 $15 $0 ~$1 ~$16

Scenario 2: Enterprise (10TB Storage + 50TB Downloads)

Service Storage Cost Egress Cost Request Costs* Total Monthly
S3 + CloudFront $250 $4,250 ~$50 ~$4,550
Cloudflare R2 $150 $0 ~$10 ~$160

How to use R2 Cloudflare

Cloudflare R2 is fully S3 API-compatible, we can change the S3 endpoint and credential to use Cloudflare R2 API
Sample: https://ruanmartinelli.com/blog/cloudflare-r2-pre-signed-urls/