We load up .html pages on the server, then the server turns them into useful documents on the user’s browsers. SSR is the traditional rendering method and it worked just as fine until the webs became so complicated and interactive.
A more recent kind of rendering method where the contents are rendered in the browser via a JavaScript framework. CSR takes two round trips to the server. First request is to get the bare-bones HTML source code which has very little indexable HTML in it, then in the second request, the rest of the site will rendered from .js file using browser.
How Google Search Engine works
The initial page with CSR will be like this:
<html>
<head>
<script src="js-framwork.js"></script>
<script src="app.js"></script>
</head>
<body>
<div id="root"></div>
</body>
</html>app.js will have all the HTML contents in JS as strings. Before the page is fully rendered, the search engine can’t locate any stuff from body.
For SSR, having HTML content in the source code, the search engine can request, crawl and index it during the first wave. Thus it is advantageous to appear in search results in short time.
With CSR, since the content is not rendered until the page is loaded on the browser, the web page will have to wait for the second wave when the indexable content is finally available.
But the thing is not every search engine employs the JS rendering capabilities like Google does. Resulting in web developers struggling with thier CSR not being ranked in search results.
Sources
https://medium.com/@benjburkholder/javascript-seo-server-side-rendering-vs-client-side-rendering-bc06b8ca2383 https://medium.com/@adamzerner/client-side-rendering-vs-server-side-rendering-a32d2cf3bfcc https://www.freecodecamp.org/news/what-exactly-is-client-side-rendering-and-hows-it-different-from-server-side-rendering-bd5c786b340d/