Static Site Generation (SSG)
Static Site Generation (SSG) is a technique where a site's HTML pages are pre-rendered once at build time and served as plain static files, rather than being generated per request on the server or entirely in the browser.
Definition
Static Site Generation (SSG) is a technique where a site's HTML pages are pre-rendered once at build time and served as plain static files, rather than being generated per request on the server or entirely in the browser.
Overview
SSG sits between traditional server rendering and client-side rendering: instead of generating HTML on every request like Server-Side Rendering (SSR), a build process runs ahead of time — pulling data from a CMS, database, or markdown files — and outputs a complete set of static HTML files that can be served directly from a CDN with no server-side compute per visit. Because the pages are pre-built, SSG sites tend to be extremely fast and cheap to host, and they are inherently resilient to traffic spikes since there's no per-request rendering cost. Tools like Astro, Gatsby, Hugo, and Next.js (in its static export mode) all support SSG, often pulling content from a Headless CMS so non-technical editors can update content that gets baked into the next build. The main trade-off is freshness: content changes require a new build and redeploy (or a mechanism like Incremental Static Regeneration (ISR) to update pages without a full rebuild), which makes SSG better suited to content that changes infrequently — blogs, documentation, marketing pages — than to highly dynamic, personalized, or frequently updated data.
Key Concepts
- HTML pre-rendered at build time, served as static files
- Extremely fast page loads with no per-request server compute
- Easily and cheaply hosted on a CDN
- Naturally resilient to traffic spikes
- Content typically sourced from a CMS, markdown, or database at build time
- Requires a rebuild (or ISR) to reflect content changes
Use Cases
Frequently Asked Questions
From the Blog
RAG Explained: Retrieval-Augmented Generation
RAG is how you give an LLM access to your own private data without training a new model. This guide explains the full pipeline — chunking, embeddings, vector search, and augmented generation — with a working Python example using open-source tools.
Read More AI & TechnologyWhat Is Retrieval-Augmented Generation (RAG)? A Complete Guide
Learn what retrieval-augmented generation is, how RAG connects language models to your own data, and how to build reliable, source-grounded AI answers.
Read More AI & TechnologyWhat Is Retrieval-Augmented Generation in Practice
Retrieval-augmented generation grounds an LLM in your own documents, fetching relevant text at query time so answers stay accurate, current, and traceable to sources.
Read More Cloud & CybersecurityCross-Site Scripting (XSS) Explained
Cross-site scripting lets attackers run malicious JavaScript in your users' browsers. Learn the three XSS types and how output encoding and CSP stop them.
Read More