For further actions, you may consider blocking this person and/or reporting abuse
Read next
![imransaifi profile image](https://media.dev.to/cdn-cgi/image/width=100,height=100,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F923198%2F665666f1-6fc3-4421-9d23-31175ca2f595.png)
The Ins and Outs of the Kubeconfig File in Kubernetes: A Complete Breakdown
Mohammad Imran -
![k_ilhame profile image](https://media.dev.to/cdn-cgi/image/width=100,height=100,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2008588%2F13bba563-2a20-489a-84df-63d2daa89754.jpeg)
LLM Adoption Accelerates Innovation and Industry Development
Kodade Ilhame -
![spencerlepine profile image](https://media.dev.to/cdn-cgi/image/width=100,height=100,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1405790%2F88ff7414-7b3f-454c-abd5-0f3d744fc2a8.png)
GET, POST, PUT & DELETE with Next.js App Router
Spencer Lepine -
![devabdul profile image](https://media.dev.to/cdn-cgi/image/width=100,height=100,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1246433%2Fa2464f13-ec7c-42b3-b796-a0fba5b01c46.jpg)
Make todoApp API in PHP & ReactJS with login register facility.
Abdul Haseeb -
Top comments (5)
Client-side rendering is like getting a large toy at Christmas that requires assembly. Server-side rendering is like getting the same large toy pre-assembled and batteries included. If you get it fully assembled, you might still disassemble and reassemble parts of that toy (server-side + client-side rendering).
Scenario 1 (Client-side rendering)
You open a very large present to discover it is a barbie princess castle set, and it is completely disassembled. Dad hands you a screwdriver and says have fun. You put your construction hat on and spend hours going back and forth between the manual and the under-construction castle, putting it together step-by-step. Eventually construction is done. Your fiends come over, and they play with it.
Translation
You open a complex web app and it is completely client rendered. The CDN hands you all the assets and says have fun. You start initializing the client app and spend milliseconds or seconds going back and forth between the app's data API and the under-construction app, constructing the UI step-by-step. Eventually construction is done. Everything is now ready for the user, and they play with it.
Scenario 2 (Server-side rendering)
You open a very large present to discover it is a barbie princess castle set, and it is fully assembled. Your friends come over, and they play with it.
Translation
You open a complex web app, and it is fully server rendered. Everything is pre-loaded for the user, and they play with it.
AFAIK, server-side rendering is primarily to speed up the initial page load. Afterward, the client side takes over and can re-render parts of the UI as needed.
Thanks.
Not sure if I addressed the point of: Why not just use server-side rendering all the time? Initial versions of web applications did just that, because Javascript didn't have enough features or performance to render client-side. To get new information from the server, you had to send the current state of the page back to the server (via form post, before AJAX) and let the server run logic, decide what to render next, and then render it as HTML+JS before returning to the client. Submitting a form caused the whole page to go into a loading state, effectively freezing the UI, until a network round trip + server processing was finished. Client-side rendering came later to make the UI stay interactive/responsive while requests were sent to the server. This provided a much better user experience, but often the initial load times were slow as the application files downloaded and initialized. Server-rendering comes back into the picture now as an optimization for the initial page load. Server-rendering can pre-compute the initialization phase of an otherwise client-side rendered app to save app startup time.
This one complements the previous reply and covers the second part very well. So it is a case of optimization which one should do for faster loading (initial load with server side rendering) and making use of client CPU for further route changes. Right?
But, what role SEO plays here? If we need to have server side rendering for SEO purposes then it won't just remain the case of initial page load, isn't it? We will need to have server side rendering for all those pages for which we need SEO, right? If yes, then why go for client side rendering at all?
This is a good question that I unfortunately don't know the answer to. The vast majority of my work has been behind logins, so SEO is a non-issue. I actually have the opposite experience of setting up robots.txt and other things to block search engine crawlers.