Static Site on Cloudflare R2

  • Luis de Sousa
  • Feb 8, 2026

A cost-optimized static website served from Cloudflare R2 with aggressive CDN caching and a zero-egress pricing model. This is the architecture behind allaboutdata.eu itself.

Architecture

flowchart TB subgraph DevWorkflow["Developer Workflow"] Dev[Developer] GitPush[Git Push to main] end subgraph GH["GitHub"] GHRepo[Repository] subgraph GHA["GitHub Actions"] Trigger[Trigger: push to main
web/** or .github/**] S3Sync[aws s3 sync to R2
S3-compatible API] CacheCtl[aws s3 cp
Cache-Control: max-age=604800] end end subgraph CF["Cloudflare"] CFDNS[DNS Zone
allaboutdata-test.uk] CFTLS[HTTPS / TLS
Managed Certificate] CFCDN[Cloudflare CDN
Global Edge Network] subgraph CFRules["Rulesets (Terraform)"] Rewrite[Transform Rule
/ → /index.html] CacheRule[Cache Rule
Edge: 7d / Browser: 4h] end subgraph CFR2["R2 Object Storage"] Bucket[R2 Bucket
WEUR Region] end end subgraph IaC["Infrastructure as Code"] TF[Terraform
Cloudflare Provider v5] end User[End User
Browser] %% Deploy Flow Dev --> GitPush GitPush --> GHRepo GHRepo --> Trigger Trigger --> S3Sync S3Sync --> CacheCtl CacheCtl -->|S3-compatible endpoint| Bucket %% Terraform Provisioning TF -->|Provisions| Bucket TF -->|Provisions| CFDNS TF -->|Provisions| Rewrite TF -->|Provisions| CacheRule %% Request Flow User -->|HTTPS Request| CFDNS CFDNS --> CFTLS CFTLS --> CFCDN CFCDN --> Rewrite Rewrite --> CacheRule CacheRule -->|Cache MISS| Bucket CacheRule -->|Cache HIT| User Bucket -->|Origin Response| CFCDN CFCDN -->|Response| User %% Styling classDef cloudflare fill:#F6821F,stroke:#F6821F,color:#fff classDef github fill:#24292E,stroke:#24292E,color:#fff classDef user fill:#4285F4,stroke:#1a73e8,color:#fff classDef terraform fill:#7B42BC,stroke:#5C2D91,color:#fff classDef storage fill:#F6821F,stroke:#E05D00,color:#fff class CFDNS,CFTLS,CFCDN,Rewrite,CacheRule cloudflare class Bucket storage class GHRepo,Trigger,S3Sync,CacheCtl github class User,Dev,GitPush user class TF terraform

The Stack

  • Build: Hugo Static Site Generator
  • Storage: Cloudflare R2 (S3-compatible)
  • CDN: Cloudflare Global Network (300+ PoPs)
  • Egress: $0.00 (Zero egress fees)
  • TLS: Automatic HTTPS

Why R2?

Traditional cloud storage charges for every byte that leaves the bucket. Cloudflare R2 eliminates egress fees entirely, making it ideal for content-heavy static sites.

Combined with Cloudflare’s global CDN, your content is cached at the edge — meaning most requests never even hit the origin bucket.

Cost Breakdown

ComponentMonthly Cost
R2 Storage~$0.015/GB
R2 Operations~$0.004
CDNIncluded
Egress$0.00
Total< $0.04/month

Deployment Pipeline

The site builds with Hugo, and the output is synced to R2 via GitHub Actions. The entire deployment takes under 30 seconds from push to live.