Skip to content
BENIBIX Learn

Static Site Generation (SSG)

Development🌐 Web DevelopmentRendering

Also known as SSG, Static Site Generator, Pre-rendering

Pages are built as HTML files ahead of time. Then no one has to wait.

Think of it like

Think of it like printing all the menus before the café opens. No one waits for a menu.

Example

Jack's docs site has 300 pages. A build turns them into HTML files in 20 seconds, and the host serves them for free.

Why it matters

Pre-built pages are the fastest and cheapest to serve. Nothing can break at request time.

Definition

Static site generation builds each page as an HTML file ahead of time. This happens before anyone visits. A build step reads the content and templates and writes out the files. The server then just hands out those files, which is very fast and cheap. When the content changes, you run the build again. It suits blogs, docs and any page that is the same for everyone.

Common mistake

Using it for pages that change each minute. You would have to rebuild all the time.

Key takeaways

  1. 1
    Built ahead of time. Before anyone asks.
  2. 2
    Just files. Fast, cheap, hard to break.
  3. 3
    Rebuild to change. New content means a new build.

Compare