Course contentsShow
← Web Development
Lesson 1722 of 2,98232. Server-Side Rendering ConceptsFree lesson

The SSG Build and Delivery Process

Following content from build-time generation through CDN distribution to browser delivery.

The SSG Build and Delivery Process

You'll learn: How static site generation transforms your source files into deployable HTML and delivers them to users with maximum efficiency.

The Journey from Code to Browser

Think of SSG like a factory that produces thousands of pre-packaged meals at once, then distributes them to stores (CDNs) for instant pickup. Unlike CSR (cooking at the customer's house) or SSR (cooking per order at a restaurant), SSG does all the work upfront during a build step.

The Build Process

When you run your SSG build command, the framework:

  1. Reads your source files — components, data sources, markdown files, API responses
  2. Generates static HTML for every possible route/page in your site
  3. Bundles JavaScript and CSS for interactivity and styling
  4. Optimizes assets — images, fonts, and other static resources
  5. Outputs a dist or build folder containing complete, ready-to-serve HTML files

This happens once per deployment, not per request.

Distribution via CDN

The generated static files are uploaded to a Content Delivery Network (CDN) — a network of servers distributed globally. Your HTML, CSS, JavaScript, and images are replicated across dozens or hundreds of edge locations.

Delivery to Browser

When a user visits your site:

  1. Their browser requests a page
  2. The CDN serves the pre-built HTML file from the nearest edge server
  3. The browser receives complete, rendered HTML instantly
  4. JavaScript "hydrates" the page, making it interactive

No server processing happens per request — just file delivery. This makes SSG incredibly fast and scalable.

Key Takeaway: SSG builds all pages at deploy time, stores them on a CDN, and delivers pre-rendered HTML files directly to browsers with zero server processing per request.