<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Arjad Gohar</title>
    <description>The latest articles on DEV Community by Arjad Gohar (@arjad_gohar_f6d9b8938c997).</description>
    <link>https://dev.to/arjad_gohar_f6d9b8938c997</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2459069%2Fabfcb9b6-47c1-4dac-9f88-387557b060f1.png</url>
      <title>DEV Community: Arjad Gohar</title>
      <link>https://dev.to/arjad_gohar_f6d9b8938c997</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/arjad_gohar_f6d9b8938c997"/>
    <language>en</language>
    <item>
      <title>Client-side Rendering &amp; Server-side Rendering</title>
      <dc:creator>Arjad Gohar</dc:creator>
      <pubDate>Wed, 20 Nov 2024 13:56:26 +0000</pubDate>
      <link>https://dev.to/arjad_gohar_f6d9b8938c997/client-side-rendering-server-side-rendering-p99</link>
      <guid>https://dev.to/arjad_gohar_f6d9b8938c997/client-side-rendering-server-side-rendering-p99</guid>
      <description>&lt;p&gt;&lt;strong&gt;Client-side rendering&lt;/strong&gt;, also referred to as CSR, the browser renders the page itself with the use of JS. Instead of sending a ready-made page from the server, the server provides the JavaScript that will run in the browser and construct the content as the user interacts with the site. We have a lot of examples of client-side rendering websites, i.e facebook, and other social media, as they need continuous page load.&lt;/p&gt;

&lt;p&gt;Process: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Server sends an initial HTML file.&lt;/li&gt;
&lt;li&gt;Client-side download JS code from server.&lt;/li&gt;
&lt;li&gt;The JS code outputs the final UI.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffkbxbsw3etdijdt2nc78.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffkbxbsw3etdijdt2nc78.png" alt="Image description" width="516" height="396"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Pros:&lt;br&gt;
    - More dynamic and interactive web applications.&lt;br&gt;
    - It provides a smoother experience for users and every load.&lt;br&gt;
    - It reduces the extra need for server-side-requests.&lt;/p&gt;

&lt;p&gt;Cons:&lt;br&gt;
    - It has slower initial load times.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Server-side rendering&lt;/strong&gt;, also abbreviated as SSR, is when the server composes and sends to client-side a fully-formed HTML page which includes all dynamic content. The browser, then, simply displays the page without any need to do extra work. As a result, users view content at a faster speed since all processing happens on the server side. For example, as I have read somewhere that wordpress &amp;amp; github are based on server-side rendering (correct me, if I am wrong)&lt;/p&gt;

&lt;p&gt;Process:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Server receives a request for the web page, retrieves the data required, populates into an HTML, and applies the necessary styles.&lt;/li&gt;
&lt;li&gt;Now, the fully rendered page is sent by the server to the browser to show.&lt;/li&gt;
&lt;li&gt;In the case of initial page loading, no type of JS is required.&lt;/li&gt;
&lt;li&gt;Subsequent user interactions and updates are managed by the client-side JS rendering.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcuyr1chdi7g2fe9ydaog.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcuyr1chdi7g2fe9ydaog.png" alt="Image description" width="516" height="445"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Pros:&lt;br&gt;
    - It loads faster the first time.&lt;br&gt;
    - Better user experience even with a slower network.&lt;/p&gt;

&lt;p&gt;Cons:&lt;br&gt;
    - More server load requires.&lt;br&gt;
    - It will be slow when it is requested multiple times.&lt;/p&gt;

&lt;p&gt;In a nutshell:&lt;br&gt;
 &lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0duqcber7dhq2ljdyaog.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0duqcber7dhq2ljdyaog.png" alt="Image description" width="567" height="604"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At last, I will add my own opinion to it, for applications that consider interactivity and user engagement as the top aspects, like social media or web applications with lots of client-side logic, CSR stands the best. However, where content is heavy, such as websites with more of an interest in SEO and fast initial load speeds, SSR will be a better option. It depends on the nature of the application and target audience to be determined.&lt;/p&gt;

&lt;p&gt;Thus, by careful analysis of the strength and weakness, the developer can take a decision to have the right rendering strategy balancing performance, usability, and searchability.&lt;/p&gt;

&lt;p&gt;Happy Coding. Thanks.&lt;/p&gt;

</description>
      <category>csr</category>
      <category>ssr</category>
      <category>webdev</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
