This content originally appeared on DEV Community and was authored by Kashif Nehal
Client Side Rendering:
We have to bundle all our components & send them to the client for rendering.
(Large bundles)
This means as our app grows, so does our bundles. Larger the bundle, more memory we need on client to load all these components.
(Resource heavy)
Search-engine bots can't view our content, coz they can't execute JS code so they can't render our components like web browsers do.
(No SEO)
Any sensitive data in our components or their dependencies like API keys will be exposed to the client.
(Less Secure)
Server Side Rendering:
Only send essential components to the client & prevent our bundle from becoming large unnecessarily.
(Small bundles)
Because server handles most of the rendering, we need less resources on the client.
(Resource efficient)
As rendering is done on the server & we send actual content to the client, not the JS files to execute. Search engine bots can view the content, understand & index the pages.
(SEO)
We can keep sensitive data like API keys on the server.
(More Secure)
Wrap-up
Initial Page Load:
CSR: Slower
SSR: Faster
Subsequent Page Loads:
CSR: Faster
SSR: Slower
SEO:
CSR: May be challenging
SSR: Better
User Experience:
CSR: More interactive
SSR: Less interactive (initially)
Server Load:
CSR: Lower
SSR: Higher
JavaScript Requirement:
CSR: Required
SSR: Not required
This content originally appeared on DEV Community and was authored by Kashif Nehal
Kashif Nehal | Sciencx (2024-09-07T22:25:40+00:00) Client Side Rendering (CSR) vs Server Side Rendering (SSR): Simplified Story. Retrieved from https://www.scien.cx/2024/09/07/client-side-rendering-csr-vs-server-side-rendering-ssr-simplified-story/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.