← Back to Tutorials

Nuxt SSR & SSG

Server-side rendering and static site generation. When to use each for optimal performance.

Server-Side Rendering (SSR)

SSR renders pages on the server for each request. Great for dynamic content and SEO.

// nuxt.config.ts
export default defineNuxtConfig({
  ssr: true
})

Static Site Generation (SSG)

SSG pre-renders pages at build time. Faster loading, great for content sites.

// nuxt.config.ts
export default defineNuxtConfig({
  ssr: false
})

ISR (Incremental Static Regeneration)

Combine static generation with on-demand updates for the best of both worlds.

Key takeaways

  • SSR for dynamic, SEO-critical pages
  • SSG for static content sites
  • ISR for content that updates periodically
  • Choose based on your content strategy