ADR-001 — Astro Static Generation on Cloudflare Pages
Status: Accepted Date: 2026-10-12 Authors: Engineering & Architecture Team
Context
The astro-static-site platform needs to host blogs and articles for global public readers. The solution must support fast page loads and high availability while defending against resource exhaustion (DDoS/traffic floods) and keeping hosting costs near zero ($0 base cost). See BRD-001 and SR-001.
Two decisions were needed:
- Rendering model: dynamic server-side rendering (Node.js/CMS) versus ahead-of-time static site generation (Astro SSG).
- Hosting and edge infrastructure: a multi-service setup (Firebase + Cloudflare proxy, or AWS S3 + CloudFront) versus a single-provider edge platform (Cloudflare Pages).
Image storage is decided separately in ADR-002.
Decision Drivers (FRs & NFRs)
- BR-1.1 / SR-F-01 — pre-rendered static HTML output at a $0 base hosting cost.
- BR-1.2, BR-2.2 / SR-NF-01, SR-NF-02 — edge WAF and rate limiting absorb traffic floods without a bandwidth bill.
- BR-2.1 / SR-F-01 — no backend runtime, so no database attack surface.
- BR-1.3 / SR-F-02, SR-F-03 — automated build and deployment from Git.
- BR-2.3 — no separately addressable origin server to expose.
Decision — Rendering model and hosting platform
Option 1 — Node.js / Dynamic CMS (WordPress, SSR Express, Astro server mode)
Serve content dynamically on every request using a live application server and database.
Pros:
- Dynamic features (search, comments, sign-ups) are available without third-party services.
Cons:
- High base cost ($10–$50+ per month) and bandwidth risk.
- Highest security risk profile: SQL injection, remote code execution and database leaks.
- High setup and operations complexity.
Option 2 — Astro SSG + AWS S3 + AWS CloudFront
Compile to static HTML, store files in an S3 bucket, and serve them through CloudFront for edge caching and SSL.
Pros:
- Static output with a low security risk profile.
- Minimal cost ($0.50–$5 per month).
Cons:
- Usage-based bandwidth charges.
- Medium setup complexity (IAM, S3 policies, origin access control).
- Several services to manage instead of one.
Option 3 — Astro SSG + Firebase Hosting (+ optional Cloudflare proxy)
Deploy compiled static files to Firebase Hosting, optionally with Cloudflare DNS/WAF in front for custom rate limiting.
Pros:
- Free tier with a $0 base cost.
- Static output with a low security risk profile.
Cons:
- Free bandwidth is capped (360 MB per day).
- Medium complexity with two providers for SSL and DNS.
Option 4 — Astro SSG + Cloudflare Pages (CHOSEN)
Compile to static HTML and deploy directly to Cloudflare Pages, using its native DNS, CDN, edge WAF, and unlimited bandwidth on the free tier.
Pros:
- Zero base running cost and no egress fees: unlimited bandwidth on the free tier removes bandwidth overage charges (“denial of wallet”).
- Minimal attack surface: no live application servers or databases, so SQL injection and remote-code-execution vectors are removed.
- Simplified operations: DNS, CDN, edge storage, WAF, rate limiting and SSL certificates sit in a single control plane, with no proxying between providers.
- Pipeline publishing: Pages accepts a direct upload of
dist/, so publishing is one step of the release workflow, with a token that can deploy Pages only.
Cons:
- No server-side dynamic logic: any future dynamic capability (search, comments, newsletter sign-ups) must use client-side JavaScript APIs or third-party SaaS integrations.
- Vendor lock-in at the edge layer: heavy reliance on Cloudflare’s edge ecosystem, though the static files in
dist/remain portable to any standard web host.
Final Decision
Render the site ahead of time with Astro and host it on Cloudflare Pages (Option 4). It gives the lowest cost, the smallest attack surface and the simplest operations, and it meets BR-1.1 to BR-2.3 with a single provider. Options 1 to 3 were rejected for higher cost, a larger security surface or split-provider complexity. The accepted cost is the loss of server-side dynamic logic and a dependence on Cloudflare at the edge.