poster
Pre-rendering and Data fetching

Data fetching in Next.js allows you to render your content in different ways, depending on your application’s use case. These include pre-rendering with Server-side Rendering or Static Generation, and updating or creating content at runtime with Incremental Static Regeneration.

Server-side Rendering — Exporting a function called ‘getServerSideProps’ from a page will pre-render that page on each request. ‘getServerSideProps’ will run on the server-side and the server will send rendered files to the client.

This is an inefficient approach as server will have to process data or send a request to the API at every request, this reduces performance and speed of the website.