
Static Site Generation (SSG)
Static Site Generation is a method of building websites where all pages are pre-rendered at build time into static HTML files, resulting in extremely fast load times and simple hosting.
Static Site Generation (SSG) creates all of a website's pages during a build step, before any user visits the site. The result is a collection of plain HTML, CSS, and JavaScript files that can be served directly by a CDN without any server-side processing per request. Unlike dynamic websites that generate pages on every request (SSR) or in the browser (CSR), static sites are pre-built.
This eliminates server processing time and database queries, resulting in the fastest possible load times. Popular static site generators include Next.js (which supports both SSG and SSR), Gatsby, Hugo, Eleventy, and Astro. These tools take your content (from markdown files, a CMS, or an API) and templates, then generate a complete website during the build process.
In practice
- A documentation site with 5,000 pages built with SSG loads every page in under 200ms because there's zero server processing, just serving pre-built HTML from a CDN
- A marketing agency switched their client websites from WordPress to a static site generator, reducing hosting costs by 90% while improving page speed scores to near-perfect
- A blog with 1,000+ articles uses SSG with incremental rebuilds, adding new content in seconds without regenerating the entire site
- A landing page built with SSG achieved a 99/100 Lighthouse performance score out of the box, compared to 62/100 for the previous dynamically-generated version
More in Web development
Not sure how this applies to you?
A senior engineer walks your site, your search presence and the way enquiries reach you, then writes down the three things worth fixing first. You keep the document either way.