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:12/06/2025, 03:57:31 AM
Page Size:~15KB (gzipped)
First Load:< 100ms