Static site generation (SSG)
Static site generation (SSG) is building all of a website's pages as ready-made HTML files ahead of time, rather than creating each page on the server when a visitor requests it.
With SSG, the work happens once at build time. When someone visits, the server simply sends a finished file, often from a CDN.
In more detail
Frameworks such as Astro, Next.js, Hugo, Eleventy and Gatsby support static generation. Content can come from Markdown files, a headless CMS or APIs. When content changes, the site rebuilds, often automatically. Interactive features can still be added with JavaScript islands or serverless functions, such as forms. Very large or rapidly changing sites may combine static generation with server-side rendering or incremental rebuilds.
Why it matters
Static sites are extremely fast, secure (there is no database to attack on each request), cheap to host and easy for search engines and AI crawlers to read, because the full HTML is there immediately.
A marketing agency rebuilds its site with Astro as a static site on a global CDN. Pages load in under a second worldwide, Lighthouse scores reach 100 and hosting costs fall to almost nothing.