What is Server-side rendering and Client-side rendering
Server side rendering
Server-side rendering or SSR is the traditional method that was used to render web pages for a long time. When a user sends a request to the server, the server sends back all the necessary files with the full HTML content. With server-side rendering the server handles everything.
- SEO-friendly. Google Bots can rank the website properly because they get the content of the HTML file from the server.
- Fast first page load time.
- Slower second and further page load time. Page reloads every time a user changes the route which makes it slow.
Client side rendering
- Fast Second and further page load time. CSR doesn’t send a request to the server every time you change the route which makes it faster.
- Slow first page load time.
As you can see both CSR and SSR have their own Pros and Cons. We can say that you can use CSR when you are building web applications and there are a lot of user interaction, and SSR when you care about SEO and there is not that much user interaction.