SSG (Static Site Generation)
Pre-generate all pages at build time for the fastest loading speed and optimal SEO performance. This page was generated at build time on 12/06/2025, 03:57:31 AM.
How SSG Works
Build Time Generation
During npm run build or npm run generate, Nuxt pre-renders all pages as static HTML files
CDN Distribution
Static files can be deployed to any CDN or static hosting service like Netlify, Vercel, GitHub Pages
Lightning Fast Loading
Users get pre-generated HTML directly, no server rendering needed, extremely fast loading
Performance Metrics
Loading Time Comparison
SSG Advantages
First load time typically < 100ms
Complete HTML content, easily indexed by search engines
No server needed, can deploy to free CDN
Static files, no server security risks
Use Cases
Documentation Sites
Technical docs, API documentation, user manuals with relatively fixed content
Corporate Websites
Company introduction, product showcase, contact information and marketing sites
Personal Blogs
Low-frequency publishing, infrequent content updates for personal websites
Configuration Example
// nuxt.config.ts
export default defineNuxtConfig({
// Global SSG configuration
nitro: {
prerender: {
routes: ['/ssg', '/about', '/contact']
}
},
// Route-level configuration
routeRules: {
'/ssg': { prerender: true },
'/blog/**': { prerender: true }
}
})