SSR( Server side rendering) in Next js.

Server-side rendering is a key feature of Next.js, a popular React framework for building web applications. SSR refers to rendering web pages on the server before sending them to the client’s browser. 

 

Why to choose SSR ? 

In traditional client-side rendering (CSR), the server sends a basic HTML file when we visit a website. Then, our browser fetches additional JavaScript files and builds the webpage on our device. This process can be slow, especially if we have a slower internet connection or the website contains complex elements. 

 

Next.js address this issue with SSR. When we request a webpage, the server does most of the work. It executes the necessary JavaScript code, retrieves data from APIs, performs computations, and renders the page as complete HTML content. This means that when the server sends the HTML to the device, we can see the webpage right away without waiting for additional processing on our end. 

 

Leave a comment

Your email address will not be published. Required fields are marked *