This week concludes the fifth week of my internship at 9cv9 as part of the NUS Overseas College (NOC) Southeast Asia programme. When I first started working on UrbanCV, it was the first time I had heard of Next.js. However, it was generally easy to pick up and turned out to have very interesting optimisations.
Static Generation is when HTML is generated at build time and will be reused on each request, and is the recommended way. If the pages require external data (such as a list of blog posts), the external data can be fetched at build time. This is typically used when you can pre-render a page ahead of a user’s request and since the page can be built only once and served by CDN, it is much faster than having a server render the page on every request. This can be used
Server-side rendering (also known as Dynamic Rendering) is when the HTML is generated on each request. Next.js pre-renders a page on each request, which will be slower because the page cannot be cached by a CDN, but the pre-rendered page will always be up-to-date.