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 static generation versus server-side rendering with Next.js?

What is static generation versus server-side rendering with Next.js?

Okay, so there's two forms of pre-rendering, all right? Static generation and server-side rendering. Please recall, we went into these when we went from junior to senior concepts for Next.js. But let's review and let's get a bit deeper. So static generation is the pre-rendering method that's gonna generate the HTML when? Well, recall, that would happen at build time. Pre-rendered HTML is then reused on each request. It can happen at build time because there's nothing really dynamic. When you're gonna re-request, there's no little parts that should be changing. You're just gonna reuse it on each request. Server-side rendering is the pre-rendering method that generates the HTML on each request. If you're confused, build time is when we build the project, so it's ready for deployment. Requests is when we go to the page. In the context of pre-rendering with Next.js, when we say request, we're referring to the users visiting different pages by clicking on links or directly entering the…

Contents