Skip to content

SSG (Static Site Generation)

Generating HTML pages at application build time, ready-made files are served from a CDN instantly without any server-side processing.

Definition

SSG (Static Site Generation) is a page rendering technique in which all HTML is generated once, at the time of application build. The finished HTML files are sent to a CDN and served to users without any server-side processing.

How it works:

  1. You run the application build
  2. The framework fetches data from the CMS
  3. It generates a finished HTML file for each page
  4. The files are sent to the CDN

SSG vs other approaches:

  • SSR (Server-Side Rendering) - HTML generated on the server with each request. Slower, but always up-to-date data
  • CSR (Client-Side Rendering) - the browser receives empty HTML + JavaScript, which then builds the page. Worse for SEO
  • ISR (Incremental Static Regeneration) - a hybrid of SSG and SSR. Pages are generated statically but rebuilt on demand after changes

Frameworks supporting SSG: Next.js, Astro, Nuxt, SvelteKit

When SSG works best:

  • Blog - content changes rarely, loading speed is crucial
  • Landing page - static content, maximum performance
  • Documentation - occasional changes

Why it might matter to you?

If you are building a blog, landing page, or documentation site, SSG is the easiest way to get a fast site with good SEO. Googlebot gets ready-made HTML without waiting for JavaScript. The page loads instantly because the server doesn’t have to calculate anything, it just serves the file. It also usually means cheap hosting (static files on Vercel/Netlify for free) and great Core Web Vitals without configuration. The only downside: if you change the content often, each change requires rebuilding the entire application, and that’s where ISR comes in.

  1. ISR (Incremental Static Regeneration)

    A technique combining the efficiency of static pages with the ability to update them automatically without a complete rebuild of the application.
  2. SEO

    Optimizing your site so it ranks in Google for queries your target audience searches, the cheapest long-term traffic channel for indie products.
  1. Build in Public6 minHow I created a blog in Next.js (stack, CMS, hosting, SEO)How did I build a blog about marketing for developers? Next.js with ISR, Strapi on Railway, Cloudflare R2, PostHog, Sentry, and MailerLite - the entire tech stack, decisions, and Lighthouse results.