Astro SSG: Why Static Sites Win

Build-time pre-render vs server rendering vs CDN cache — what the difference is and why it matters for performance.

Astro SSG build pipeline visualisation

In the early years of the web, every page was generated on request. PHP queried the database, filled the template — on every request, for every user. This model is flexible but slow, complex, and exposed to attacks.

CDN Cache: A Half-Solution

CDN caching partially solved this. The server renders once, the CDN distributes copies to 300+ locations. The first request is slow, subsequent ones are fast. But cache staleness is a risk — when content changes, you either flush the entire cache or users see outdated content.

Build-Time Pre-render: Astro's Approach

Astro asks a different question: when page content is known at deploy time rather than request time, why render it on every request?

Astro generates all pages as static HTML at build time. No variables, no queries, no server. What's deployed is already finished HTML. The CDN returns this HTML directly — there's never a 'cache miss' because there's no server to miss.

How This Works in AstroForge

Page definitions from pages.config.ts, organism components, and JSON content files — all read at build time and compiled into static HTML. Cloudflare Pages distributes this HTML to 300+ locations. When a user requests a page, no server runs — Cloudflare returns directly from cache.

The CMS is a separate system entirely. It runs on Cloudflare Workers, writes content to GitHub. Every save is a commit, a new build is triggered, and the site updates within 60 seconds.

Conclusion

Build-time pre-render is the best possible performance model for static content. Choosing Astro SSG means delivering the fastest experience to your users while reducing the attack surface to near zero.