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
50ms
ISR
120ms
SSR
300ms

SSG Advantages

⚑
Lightning Fast

First load time typically < 100ms

πŸ”
SEO Friendly

Complete HTML content, easily indexed by search engines

πŸ’°
Cost Effective

No server needed, can deploy to free CDN

πŸ›‘οΈ
Secure & Stable

Static files, no server security risks

Use Cases

πŸ“š

Documentation Sites

Technical docs, API documentation, user manuals with relatively fixed content

VuePressGitBookDocusaurus
🏒

Corporate Websites

Company introduction, product showcase, contact information and marketing sites

Landing PagePortfolioBrochure
✍️

Personal Blogs

Low-frequency publishing, infrequent content updates for personal websites

JekyllHexoGatsby

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 }
  }
})

πŸ“Š Page Information

Rendering Mode:SSG
Build Time:01/29/2026, 06:15:40 AM
Page Size:~15KB (gzipped)
First Load:< 100ms