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:
- Reads your source files — components, data sources, markdown files, API responses
- Generates static HTML for every possible route/page in your site
- Bundles JavaScript and CSS for interactivity and styling
- Optimizes assets — images, fonts, and other static resources
- Outputs a
distorbuildfolder 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:
- Their browser requests a page
- The CDN serves the pre-built HTML file from the nearest edge server
- The browser receives complete, rendered HTML instantly
- 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.