Free auditStart free
GlossaryGlossary · Fundamentals

Static site generation

Static site generation pre-renders HTML for every page at build time. Pages are fast, cache-friendly, and ideal for content sites and blogs.

3 min
read
3
sources
Oct 24, 2026
updated
Scaplet Editorial Team
author
In one line

Static site generation (SSG) builds finished HTML files for your pages ahead of time, at build time, instead of generating them for each request. Per web.dev, static rendering produces a separate HTML file for each URL, giving a consistently fast TTFB and CDN-friendly pages. It fits sites whose URLs you can list in advance.

30-second check

Is this costing your site traffic?

Four quick questions, then a straight answer.

1/4Have you checked your own site for this?
Summarize this page withChatGPTClaudePerplexityGoogleAI Mode
01Check it

How static site generation works

During the build, a static generator such as Jekyll or 11ty (or Next.js in its static mode) reads your content, runs your templates, and writes an HTML file for each URL. Requests are then answered with that prebuilt HTML, which can be deployed to CDNs.

The build must know which URLs exist. web.dev names this as the main drawback: static rendering must generate individual HTML files for every possible URL, which is hard when you can't anticipate them or have a very large number of unique pages.

Next.js static generation with revalidation (Pages Router)
// pages/posts/[slug].js
export async function getStaticPaths() {
  const posts = await fetchAllPosts();
  return {
    paths: posts.map((p) => ({ params: { slug: p.slug } })),
    fallback: 'blocking', // build unknown slugs on first request
  };
}

export async function getStaticProps({ params }) {
  const post = await fetchPost(params.slug);
  // Refresh in the background at most once every 3600 seconds
  return { props: { post }, revalidate: 3600 };
}
02Checklist

Why static generation is fast

  1. 01TTFB: web.dev says static rendering achieves a consistently fast TTFB, because the HTML for a page doesn't have to be dynamically generated.
  2. 02CDN caching: prebuilt files can be deployed to multiple CDNs to take advantage of edge caching.
  3. 03Core Web Vitals: web.dev says static rendering offers a fast FCP and lower TBT and INP, as long as you limit client-side JavaScript.
  4. 04Interactivity: statically rendered pages are interactive without needing to execute much client-side JavaScript.
03At a glance

Static vs. dynamic rendering approaches

Approach

Static rendering

When HTML is built
At build time
Best for
Content sites with predictable URLs
Drawback
Must generate an HTML file for every possible URL; poor fit for personalization
Approach

Server-side rendering

When HTML is built
On the server, per request
Best for
Personalized or frequently changing pages
Drawback
Generating pages takes time, which can increase TTFB
Approach

Client-side rendering

When HTML is built
In the browser
Best for
Highly interactive apps
Drawback
JavaScript grows with the app, which can impact INP
Approach

Prerender + rehydration

When HTML is built
Build or server, then JavaScript takes over
Best for
Single-page apps needing a fast first paint
Drawback
Pages can look interactive before scripts run; duplicated HTML and data can bloat the document
04Good to know

Static generation and SEO

Static output sends complete HTML in the initial response, so your content doesn't depend on JavaScript rendering to be visible. That is a property of the output, not a ranking boost: Google says good Core Web Vitals results don't guarantee that pages rank at the top of Google Search results, and that Search always seeks to show the most relevant content, even if the page experience is sub-par. Static output simply removes a class of rendering and speed problems.

The trade-off is the URL list. web.dev says generating a file for every possible URL can be challenging or even infeasible for sites with a large number of unique pages, and that pages needing personalization don't work well with static rendering.

05Explained

When to choose static generation

Choose it when you can list your URLs at build time, such as blogs, documentation, and marketing sites. web.dev's advice is to consider whether static or server rendering can get you most of the way there. Skip it, or combine it with server rendering, if you have very large numbers of unique URLs or need per-user content.

Sources · 3

Every fact, linked and dated.

Official docs first. The date is when we last opened each page.
  • web.dev
  • nextjs.org
  • google.com
  1. 01Rendering on the Web - web.devweb.dev · checked 2026-10-24
  2. 02Incremental Static Regeneration - Next.js docs (Pages Router)nextjs.org · checked 2026-10-24
  3. 03Understanding page experience in Google Search results - Google Search Centraldevelopers.google.com · checked 2026-10-24
Questions

Asked a lot.

3 questions people ask next, answered from the sources on this page.

01Is a static site outdated?

No. web.dev encourages developers to consider server-side rendering or static rendering over a full rehydration approach, and says it's fine to mostly ship HTML with minimal JavaScript.

02Can a static site have dynamic features?

Yes. Add client-side JavaScript for forms, filters, or carts, or fetch data from APIs. The page arrives as prebuilt HTML, and scripts add behavior on top.

03How do I update content on a static site?

Change the content source and rebuild, or use a feature like ISR to refresh pages in the background. Check your host's docs for how to trigger a rebuild when your content changes.

Free · 2 minutes

Know the term. Now check your site.

The free audit reads robots.txt, sitemaps, status codes, canonicals, redirects and structured data.

Free, no card60 secondsNobody will call you
  • 46 fixes shipped without a ticket Brightpipe
  • +212% organic clicks in 90 days Ledgerly