From the course: Master Next.js: Elaborate Hands-On Web Development, React Basics, Advanced Next.js, and Deployment

Unlock this course with a free trial

Join today to access over 25,200 courses taught by industry experts.

What is SSG in Next.js?

What is SSG in Next.js?

OK, so we should talk about static site generation. Just because I could hear that getting confused with server-side rendering sometimes, and that's a big no-no. So it's not the same thing. Although it does involve server-generated HTML. So you're doing that on the server. But you have to realize, with static site generation, mind the words, static site. It means that there's no active server during runtime. Actually, what happens, which is interesting, is that you can singularly produce everything during the build phase when the application is deployed. You can store that in a CDN and utilize it for all subsequent requests. It's not going to matter because you shouldn't have dynamic content. So when would you use SSG over SSR? Well, if your content doesn't change frequently and can be pre-rendered at a build time, then SSG is a great choice. So blog posts, marketing pages, things that aren't dynamically going to be updating and changing. The SEO importance is important to consider as…

Contents