With a traditional CMS, a server builds each page when someone requests it, usually by querying a database and running templates. Caching reduces that work but does not remove it. With static site generation, the work happens once, at build time, and the output is a set of HTML, CSS and image files that any web server or CDN can deliver.

The benefits are fast responses, far less for attackers to target, hosting that is inexpensive and copes with traffic spikes, and pages that keep working if the CMS behind them goes down. It suits marketing sites, blogs, documentation and most content-driven business sites.

The trade-offs are a rebuild whenever content changes, and extra work for anything personal or live, such as accounts, comments or stock levels, which is added through APIs or small interactive components. Frameworks such as Astro make that mix straightforward. This site is built this way: every page is prerendered and served from Netlify’s CDN.

Updated

YOUR NEXT CHAPTER

Tell us what you're building.

A few lines about the idea, the business and what is getting in the way.

DISCUSS YOUR PROJECT
Good work starts with a conversation. No brief needed. A few lines are enough.