01 / 07 / 2022

38. Server Side Rendering

When a user request a webpage, server prepares the page by fetching user-specific data from database, creating an HTML page and then sends it to the user’s machine. The browser then construes the content and displays the page. This entire process is known as SSR.


But how about client side rendering? When we use Frameworks such as React, Angular and Vue in creating a website, they are creating single page applications and the whole application is rendered on the client side by browser. It takes more time in rendering the first page.

By using Next.js, it builds the HTML page at build time and serves the pre-rendered page from server to browser with minimal JavaScript code and when page is loaded by browser, its JavaScript code runs and makes the page fully interactive.


By using SSR, it enables pages to load faster, improving the user experience. It also boost the performance of SEO as the search engines can easily index and crawl content because the content can be rendered before the page is loaded.