Static Site Generation
Learn about static site generation at build time.
So, here’s a question—if we need to build a dynamic page and SEO isn’t really important (admin pages, private profile pages, etc.), why don’t we just send a static page to the client and load all the data once the page has been transferred to the browser?
So far, we’ve seen two different ways of rendering our web apps: on the client side and server side. Next.js gives us a third option called static site generation (SSG).
With SSG, we will be able to pre-render some specific pages (or even the whole website if necessary) at build time; that means that when we’re building our web app, there might be some pages that won’t change their content very often, so it makes sense for us to serve them as static assets. Next.js will render these pages during the build phase and will always serve that specific HTML that, just like SSR, will become interactive thanks to the React hydration process.
Advantages of SSG
SSG brings a lot of advantages when compared to ...
Get hands-on with 1400+ tech skills courses.