<?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: koushik Hazra</title>
    <description>The latest articles on DEV Community by koushik Hazra (@koushik_hazra_49067f40231).</description>
    <link>https://dev.to/koushik_hazra_49067f40231</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4122421%2F4df513a6-9d60-41c9-8104-8e8fe2a44cda.jpg</url>
      <title>DEV Community: koushik Hazra</title>
      <link>https://dev.to/koushik_hazra_49067f40231</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/koushik_hazra_49067f40231"/>
    <language>en</language>
    <item>
      <title>What Happens When You Enter a URL in Your Browser?</title>
      <dc:creator>koushik Hazra</dc:creator>
      <pubDate>Sun, 13 Sep 2026 13:31:48 +0000</pubDate>
      <link>https://dev.to/koushik_hazra_49067f40231/what-happens-when-you-enter-a-url-in-your-browser-60n</link>
      <guid>https://dev.to/koushik_hazra_49067f40231/what-happens-when-you-enter-a-url-in-your-browser-60n</guid>
      <description>&lt;p&gt;Do you have Google? Go and Type&lt;br&gt;
You type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://koushikHazra.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You press Enter.&lt;/p&gt;

&lt;p&gt;A moment later, a webpage appears.&lt;/p&gt;

&lt;p&gt;It feels almost instantaneous.&lt;/p&gt;

&lt;p&gt;But have you ever stopped to think about what actually happened during those few milliseconds?&lt;/p&gt;

&lt;p&gt;Your browser didn't simply "open a website."&lt;/p&gt;

&lt;p&gt;A surprisingly long chain of events took place:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;URL
 ↓
DNS
 ↓
IP Address
 ↓
TCP Connection
 ↓
TLS Handshake
 ↓
HTTP Request
 ↓
Server
 ↓
HTTP Response
 ↓
Browser
 ↓
HTML Parsing
 ↓
CSS + JavaScript
 ↓
Rendering
 ↓
Page
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's a lot of work for one press of the Enter key.&lt;/p&gt;

&lt;p&gt;Let's follow the journey from the beginning.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. You Enter a URL
&lt;/h2&gt;

&lt;p&gt;Suppose you type:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://koushik.com/photos
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A URL generally contains several important pieces:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://koushik.com/photos
  │        │          │
  │        │          └── Path
  │        └───────────── Domain
  └────────────────────── Protocol
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;https&lt;/code&gt; → protocol&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;koushik.com&lt;/code&gt; → domain&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;/photos&lt;/code&gt; → path&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;But your computer doesn't actually communicate with &lt;code&gt;example.com&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Networks communicate using IP addresses.&lt;/p&gt;

&lt;p&gt;So the browser needs to answer a simple question:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"What IP address belongs to example.com?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That's where DNS comes in.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. DNS — Finding the Server
&lt;/h2&gt;

&lt;p&gt;DNS stands for:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Domain Name System&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;You can think of DNS as the internet's phonebook.&lt;/p&gt;

&lt;p&gt;Humans prefer:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;google.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Computers need something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;142.250.x.x
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So the browser needs to translate the domain name into an IP address.&lt;/p&gt;

&lt;p&gt;A simplified flow looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Browser
   ↓
DNS Resolver
   ↓
Root DNS Server
   ↓
.com DNS Server
   ↓
Authoritative DNS Server
   ↓
IP Address
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;koushik.com
     ↓
93.184.216.34
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now the browser knows where to send the request.&lt;/p&gt;

&lt;h3&gt;
  
  
  📍 IMAGE 1 — Add a DNS resolution diagram here
&lt;/h3&gt;

&lt;p&gt;Create a clean technical diagram showing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Browser
   ↓
DNS Resolver
   ↓
Root
   ↓
.com
   ↓
Authoritative DNS
   ↓
IP Address
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Keep it simple. Don't use a generic internet image.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. The Browser May Already Know the IP
&lt;/h2&gt;

&lt;p&gt;There's an important optimization here.&lt;/p&gt;

&lt;p&gt;Your browser doesn't necessarily perform a complete DNS lookup every time.&lt;/p&gt;

&lt;p&gt;DNS results can be cached at multiple levels:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Browser Cache
      ↓
OS Cache
      ↓
Router Cache
      ↓
DNS Resolver Cache
      ↓
DNS Servers
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the IP address is already cached, the browser can skip much of the DNS process.&lt;/p&gt;

&lt;p&gt;This is one of the many reasons why the second visit to a website can feel faster.&lt;/p&gt;




&lt;h1&gt;
  
  
  4. Now We Need a Connection
&lt;/h1&gt;

&lt;p&gt;The browser knows the server's IP address.&lt;/p&gt;

&lt;p&gt;But it still needs a reliable connection to communicate with it.&lt;/p&gt;

&lt;p&gt;For HTTPS connections, this involves TCP and TLS.&lt;/p&gt;

&lt;p&gt;For a traditional HTTP/1.1 or HTTP/2 connection, TCP establishes the transport connection first.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. TCP Three-Way Handshake
&lt;/h2&gt;

&lt;p&gt;TCP needs to establish a connection between the client and server.&lt;/p&gt;

&lt;p&gt;This is commonly called the:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Three-Way Handshake&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The basic process is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Client                    Server

  SYN  ──────────────────→

       ←────────────────── SYN + ACK

  ACK  ──────────────────→
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In simple terms:&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1
&lt;/h3&gt;

&lt;p&gt;Client:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Can we establish a connection?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Step 2
&lt;/h3&gt;

&lt;p&gt;Server:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Yes. I received your request, and I'm ready."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Step 3
&lt;/h3&gt;

&lt;p&gt;Client:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Great. Let's communicate."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now the TCP connection is established.&lt;/p&gt;




&lt;h1&gt;
  
  
  6. HTTPS Adds TLS
&lt;/h1&gt;

&lt;p&gt;But we're accessing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;https://koushik.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;not:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;http://koushik.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;S&lt;/code&gt; in HTTPS is important.&lt;/p&gt;

&lt;p&gt;It means the HTTP communication is protected using &lt;strong&gt;TLS (Transport Layer Security)&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;TLS provides things such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Encryption&lt;/li&gt;
&lt;li&gt;Server authentication&lt;/li&gt;
&lt;li&gt;Data integrity&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;During the TLS handshake, the browser and server negotiate cryptographic parameters and establish keys that will protect the connection.&lt;/p&gt;

&lt;p&gt;You don't see any of this.&lt;/p&gt;

&lt;p&gt;You just see:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;🔒 https://koushik.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But underneath, cryptographic work is happening.&lt;/p&gt;




&lt;h2&gt;
  
  
  7. The Browser Sends an HTTP Request
&lt;/h2&gt;

&lt;p&gt;Now we're finally ready to request the webpage.&lt;/p&gt;

&lt;p&gt;The browser might send something conceptually similar to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="nf"&gt;GET&lt;/span&gt; &lt;span class="nn"&gt;/photos&lt;/span&gt; &lt;span class="k"&gt;HTTP&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="m"&gt;1.1&lt;/span&gt;
&lt;span class="na"&gt;Host&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;koushik.com&lt;/span&gt;
&lt;span class="na"&gt;User-Agent&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Chrome&lt;/span&gt;
&lt;span class="na"&gt;Accept&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;text/html&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The important part is:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GET /photos
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We're telling the server:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Please give me the resource located at /products."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The request travels through the network to the server.&lt;/p&gt;




&lt;h1&gt;
  
  
  8. What Happens on the Server?
&lt;/h1&gt;

&lt;p&gt;Now things get interesting.&lt;/p&gt;

&lt;p&gt;The request reaches the backend application.&lt;/p&gt;

&lt;p&gt;Imagine the server is running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Node.js
Express.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The request might pass through several layers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Request
   ↓
Load Balancer
   ↓
Web Server
   ↓
Express Router
   ↓
Middleware
   ↓
Controller
   ↓
Service
   ↓
Database
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;GET /products
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;might eventually trigger:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;photos&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;find&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The backend retrieves the required information from the database.&lt;/p&gt;

&lt;p&gt;For a dynamic application, the server might need to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Authenticate the user&lt;/li&gt;
&lt;li&gt;Check permissions&lt;/li&gt;
&lt;li&gt;Query the database&lt;/li&gt;
&lt;li&gt;Fetch data from another service&lt;/li&gt;
&lt;li&gt;Generate HTML&lt;/li&gt;
&lt;li&gt;Return JSON&lt;/li&gt;
&lt;li&gt;Cache the result&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All of this can happen before your browser receives the response.&lt;/p&gt;




&lt;h1&gt;
  
  
  9. The Server Sends an HTTP Response
&lt;/h1&gt;

&lt;p&gt;The server now sends a response back.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="k"&gt;HTTP&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="m"&gt;1.1&lt;/span&gt; &lt;span class="m"&gt;200&lt;/span&gt; &lt;span class="ne"&gt;OK&lt;/span&gt;
&lt;span class="na"&gt;Content-Type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;text/html&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;followed by the HTML document:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Products&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;

  &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Products&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The browser receives the response.&lt;/p&gt;

&lt;p&gt;But we're still not finished.&lt;/p&gt;

&lt;p&gt;In fact, this is where the browser's real work begins.&lt;/p&gt;




&lt;h1&gt;
  
  
  10. The Browser Parses HTML
&lt;/h1&gt;

&lt;p&gt;The browser reads the HTML and builds a structure called the:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DOM — Document Object Model&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;photos&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Explore our products.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;becomes a tree-like structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Document
   │
   └── html
        │
        └── body
             ├── h1
             │    └── Products
             │
             └── p
                  └── Explore our products.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The browser uses this structure to understand what should appear on the page.&lt;/p&gt;




&lt;h1&gt;
  
  
  11. Then Comes CSS
&lt;/h1&gt;

&lt;p&gt;Suppose the HTML contains:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;h1&lt;/span&gt; &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"title"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;photos&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;and the CSS says:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.title&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;font-size&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;32px&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The browser downloads and parses the CSS.&lt;/p&gt;

&lt;p&gt;It creates another internal structure describing the styles.&lt;/p&gt;

&lt;p&gt;The browser then combines information from HTML and CSS to determine:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;What should this page look like?&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h1&gt;
  
  
  12. JavaScript Enters the Picture
&lt;/h1&gt;

&lt;p&gt;Modern websites rarely consist of only HTML and CSS.&lt;/p&gt;

&lt;p&gt;JavaScript can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fetch API data&lt;/li&gt;
&lt;li&gt;Handle button clicks&lt;/li&gt;
&lt;li&gt;Update the UI&lt;/li&gt;
&lt;li&gt;Validate forms&lt;/li&gt;
&lt;li&gt;Create animations&lt;/li&gt;
&lt;li&gt;Communicate with WebSockets&lt;/li&gt;
&lt;li&gt;Modify the DOM&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/api/photos&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;might trigger another HTTP request.&lt;/p&gt;

&lt;p&gt;So your original page request can lead to many additional requests:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                    ┌── CSS
                    │
HTML ───────────────┼── JavaScript
                    │
                    ├── Images
                    │
                    ├── Fonts
                    │
                    └── API requests
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's why opening one website can result in dozens or even hundreds of network requests.&lt;/p&gt;




&lt;h1&gt;
  
  
  13. The Browser Finally Renders the Page
&lt;/h1&gt;

&lt;p&gt;Now the browser has enough information to start turning everything into pixels.&lt;/p&gt;

&lt;p&gt;A simplified rendering pipeline looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;HTML
 ↓
DOM

CSS
 ↓
CSSOM

DOM + CSSOM
 ↓
Render Tree
 ↓
Layout
 ↓
Paint
 ↓
Compositing
 ↓
Screen
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Layout
&lt;/h3&gt;

&lt;p&gt;The browser calculates:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Width&lt;/li&gt;
&lt;li&gt;Height&lt;/li&gt;
&lt;li&gt;Position&lt;/li&gt;
&lt;li&gt;Spacing&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Paint
&lt;/h3&gt;

&lt;p&gt;It determines what needs to be visually drawn:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Text&lt;/li&gt;
&lt;li&gt;Colors&lt;/li&gt;
&lt;li&gt;Borders&lt;/li&gt;
&lt;li&gt;Images&lt;/li&gt;
&lt;li&gt;Shadows&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Compositing
&lt;/h3&gt;

&lt;p&gt;The browser combines different layers and produces the final visual output.&lt;/p&gt;

&lt;p&gt;And finally...&lt;/p&gt;

&lt;p&gt;You see the webpage. 🎉&lt;/p&gt;




&lt;h1&gt;
  
  
  📍 IMAGE 2 — Add the Browser Rendering Pipeline Here
&lt;/h1&gt;

&lt;p&gt;This is probably the most important visual in the article.&lt;/p&gt;

&lt;p&gt;Show:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;HTML → DOM
CSS → CSSOM

DOM + CSSOM
      ↓
 Render Tree
      ↓
    Layout
      ↓
    Paint
      ↓
 Compositing
      ↓
   Browser Screen
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A clean technical diagram would make this section much easier to understand.&lt;/p&gt;




&lt;h1&gt;
  
  
  14. So How Fast Did All of This Happen?
&lt;/h1&gt;

&lt;p&gt;Usually, very fast.&lt;/p&gt;

&lt;p&gt;But the actual time depends on many factors:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;DNS lookup
+
Connection setup
+
TLS handshake
+
Server processing
+
Network latency
+
HTML parsing
+
CSS processing
+
JavaScript execution
+
Rendering
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is why web performance is much more complicated than:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"My server responds in 100 ms."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;The server might respond quickly, but the browser could still spend significant time downloading and executing JavaScript.&lt;/p&gt;

&lt;p&gt;Likewise, a fast frontend can't completely hide a slow backend.&lt;/p&gt;

&lt;p&gt;Web performance is a chain.&lt;/p&gt;




&lt;h1&gt;
  
  
  15. And This Connects Back to SSR vs CSR
&lt;/h1&gt;

&lt;p&gt;This is where things start connecting.&lt;/p&gt;

&lt;p&gt;Remember the difference between SSR and CSR?&lt;/p&gt;

&lt;p&gt;With SSR:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Browser
   ↓
Server
   ↓
Server generates HTML
   ↓
Browser
   ↓
Render content
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With CSR:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Browser
   ↓
Server
   ↓
HTML + JavaScript
   ↓
JavaScript executes
   ↓
API request
   ↓
Data
   ↓
UI rendered
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So understanding what happens when you enter a URL makes SSR vs CSR much easier to understand.&lt;/p&gt;

&lt;p&gt;They're not isolated frontend concepts.&lt;/p&gt;

&lt;p&gt;They're part of the larger web request lifecycle.&lt;/p&gt;




&lt;h1&gt;
  
  
  16. One URL Request Is Actually a Chain of Systems
&lt;/h1&gt;

&lt;p&gt;This is the part I find most interesting.&lt;/p&gt;

&lt;p&gt;When you type one URL, you're interacting with many different technologies:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;                URL
                 │
                 ↓
                DNS
                 │
                 ↓
                TCP
                 │
                 ↓
                TLS
                 │
                 ↓
               HTTP
                 │
                 ↓
             Web Server
                 │
                 ↓
            Application
                 │
                 ↓
              Database
                 │
                 ↓
              Response
                 │
                 ↓
              Browser
                 │
                 ↓
             Rendering
                 │
                 ↓
              Screen
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What looks like one simple action is actually a conversation between many systems.&lt;/p&gt;




&lt;h1&gt;
  
  
  🌐 The Full Journey
&lt;/h1&gt;

&lt;p&gt;Let's put everything together.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. User enters URL
          ↓
2. Browser parses URL
          ↓
3. DNS resolves domain
          ↓
4. Browser gets IP address
          ↓
5. TCP connection established
          ↓
6. TLS handshake
          ↓
7. HTTP request sent
          ↓
8. Server receives request
          ↓
9. Backend processes request
          ↓
10. Database may be queried
          ↓
11. Server sends HTTP response
          ↓
12. Browser receives HTML
          ↓
13. Browser builds DOM
          ↓
14. Browser processes CSS
          ↓
15. JavaScript executes
          ↓
16. Layout + Paint
          ↓
17. Pixels appear on screen
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And all of this happens because you pressed Enter.&lt;/p&gt;




&lt;h1&gt;
  
  
  Final Thoughts
&lt;/h1&gt;

&lt;p&gt;The next time you type a URL into your browser, remember that you're not simply "opening a website."&lt;/p&gt;

&lt;p&gt;You're starting a journey through:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;DNS → TCP → TLS → HTTP → Backend → Database → Browser → Rendering&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Understanding this journey changes how you think about web development.&lt;/p&gt;

&lt;p&gt;A slow website is no longer just:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"The website is slow."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can start asking better questions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Is DNS taking too long?&lt;/li&gt;
&lt;li&gt;Is the server slow?&lt;/li&gt;
&lt;li&gt;Is the database query inefficient?&lt;/li&gt;
&lt;li&gt;Is the network connection slow?&lt;/li&gt;
&lt;li&gt;Is JavaScript blocking rendering?&lt;/li&gt;
&lt;li&gt;Are we sending too much data?&lt;/li&gt;
&lt;li&gt;Are we rendering on the server or client?&lt;/li&gt;
&lt;li&gt;Can caching help?&lt;/li&gt;
&lt;li&gt;Can we reduce the number of requests?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;That's when web development becomes more than writing components and APIs.&lt;/p&gt;

&lt;p&gt;You start seeing the entire system.&lt;/p&gt;

&lt;p&gt;And that's where things get really interesting. 🚀&lt;/p&gt;




&lt;h2&gt;
  
  
  Quick Mental Model
&lt;/h2&gt;

&lt;p&gt;If you remember only one diagram from this article, remember this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;URL
 ↓
DNS
 ↓
IP
 ↓
TCP + TLS
 ↓
HTTP Request
 ↓
Server
 ↓
Database
 ↓
HTTP Response
 ↓
Browser
 ↓
DOM + CSSOM
 ↓
Layout
 ↓
Paint
 ↓
Screen
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One URL.&lt;/p&gt;

&lt;p&gt;A whole lot of engineering.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>beginners</category>
      <category>react</category>
    </item>
    <item>
      <title>SSR vs CSR — What Actually Happens When Your Page Loads?</title>
      <dc:creator>koushik Hazra</dc:creator>
      <pubDate>Sat, 12 Sep 2026 17:30:45 +0000</pubDate>
      <link>https://dev.to/koushik_hazra_49067f40231/ssr-vs-csr-what-actually-happens-when-your-page-loads-4490</link>
      <guid>https://dev.to/koushik_hazra_49067f40231/ssr-vs-csr-what-actually-happens-when-your-page-loads-4490</guid>
      <description>&lt;h1&gt;
  
  
  SSR vs CSR — What Actually Happens When Your Page Loads?
&lt;/h1&gt;

&lt;p&gt;If you've worked with React or Next.js for a while, you've probably heard these two terms a hundred times:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CSR — Client-Side Rendering&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;SSR — Server-Side Rendering&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;At first, they sound simple.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"CSR renders on the client, SSR renders on the server."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Technically correct.&lt;/p&gt;

&lt;p&gt;But that explanation doesn't really answer the questions that matter.&lt;/p&gt;

&lt;p&gt;What actually happens when a user opens a page?&lt;/p&gt;

&lt;p&gt;Why can one website show content almost immediately while another appears blank for a moment?&lt;/p&gt;

&lt;p&gt;Why does SSR usually help with SEO?&lt;/p&gt;

&lt;p&gt;And most importantly — &lt;strong&gt;when should you actually use SSR or CSR?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let's understand it from the browser's point of view, rather than memorizing definitions.&lt;/p&gt;


&lt;h2&gt;
  
  
  First, Let's Understand the Problem
&lt;/h2&gt;

&lt;p&gt;Imagine you're visiting an e-commerce website.&lt;/p&gt;

&lt;p&gt;You click:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;example.com/products
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your browser needs to somehow turn that URL into something you can see:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Products
────────────────────
iPhone
MacBook
AirPods
...
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The interesting question is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Who is responsible for creating this HTML?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;There are two major possibilities.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CSR → Browser creates the page

SSR → Server creates the page
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That single difference changes quite a lot.&lt;/p&gt;




&lt;h2&gt;
  
  
  🟦 CSR — Client-Side Rendering
&lt;/h2&gt;

&lt;p&gt;Let's start with something most React developers are familiar with.&lt;/p&gt;

&lt;p&gt;In a typical React application, the browser initially receives something similar to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"root"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;There's not much actual content inside it.&lt;/p&gt;

&lt;p&gt;The browser then downloads the JavaScript bundle.&lt;/p&gt;

&lt;p&gt;React starts running.&lt;/p&gt;

&lt;p&gt;The application makes API requests.&lt;/p&gt;

&lt;p&gt;The data arrives.&lt;/p&gt;

&lt;p&gt;React renders the UI.&lt;/p&gt;

&lt;p&gt;Finally, the user sees the page.&lt;/p&gt;

&lt;h3&gt;
  
  
  The flow looks like this:
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Browser
   │
   │ Request page
   ↓
Server
   │
   │ HTML + JavaScript
   ↓
Browser
   │
   ├── Download JS
   ├── Execute React
   ├── Fetch API data
   └── Render UI
   ↓
User sees page
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  📍 IMAGE 1 — Add a diagram here
&lt;/h3&gt;

&lt;p&gt;Create a clean diagram showing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;User
 ↓
Browser
 ↓
Request HTML
 ↓
Server
 ↓
Empty HTML + JS
 ↓
Browser executes JS
 ↓
API Request
 ↓
Data
 ↓
React renders UI
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A flow diagram works much better here than a random stock image.&lt;/p&gt;




&lt;h2&gt;
  
  
  Why Does CSR Feel Slow Sometimes?
&lt;/h2&gt;

&lt;p&gt;Imagine the user has a slow internet connection.&lt;/p&gt;

&lt;p&gt;The browser receives:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"root"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then it waits for JavaScript.&lt;/p&gt;

&lt;p&gt;Then React loads.&lt;/p&gt;

&lt;p&gt;Then the API request happens.&lt;/p&gt;

&lt;p&gt;Then the data arrives.&lt;/p&gt;

&lt;p&gt;Only after all of that does the user get the actual content.&lt;/p&gt;

&lt;p&gt;You might see something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Loading...
Loading...
Loading...

Products finally appear.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This doesn't mean CSR is bad.&lt;/p&gt;

&lt;p&gt;It simply means that &lt;strong&gt;the browser has more work to do before it can display meaningful content.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;And for applications like dashboards, admin panels, or highly interactive applications, that's often perfectly acceptable.&lt;/p&gt;




&lt;h1&gt;
  
  
  🟩 SSR — Server-Side Rendering
&lt;/h1&gt;

&lt;p&gt;Now let's change the approach.&lt;/p&gt;

&lt;p&gt;Instead of asking the browser to build the page, we ask the server to build it first.&lt;/p&gt;

&lt;p&gt;The flow becomes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Browser
   │
   │ Request /products
   ↓
Server
   │
   ├── Fetch product data
   ├── Generate HTML
   ↓
Browser
   │
   │ Receives complete HTML
   ↓
User sees content
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The server might send something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Products&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;iPhone&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;$999&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;MacBook&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;$1299&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The browser doesn't have to wait for React to create the initial page.&lt;/p&gt;

&lt;p&gt;It already has meaningful HTML.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Interesting Part: Hydration
&lt;/h2&gt;

&lt;p&gt;And this is where things become more interesting.&lt;/p&gt;

&lt;p&gt;Getting HTML from the server doesn't mean React is finished.&lt;/p&gt;

&lt;p&gt;The browser still needs to make that HTML interactive.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Server
   ↓
HTML
   ↓
Browser displays HTML
   ↓
JavaScript loads
   ↓
React hydrates
   ↓
Page becomes interactive
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Suppose you have a button:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight jsx"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt; &lt;span class="na"&gt;onClick&lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="si"&gt;{&lt;/span&gt;&lt;span class="nx"&gt;handleClick&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
    Add to Cart
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nt"&gt;button&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The server can send the button's HTML.&lt;/p&gt;

&lt;p&gt;But the server can't handle the user's click inside their browser.&lt;/p&gt;

&lt;p&gt;React needs to connect the JavaScript behavior to that existing HTML.&lt;/p&gt;

&lt;p&gt;That's &lt;strong&gt;hydration&lt;/strong&gt;.&lt;/p&gt;




&lt;h2&gt;
  
  
  SSR vs CSR — The Real Difference
&lt;/h2&gt;

&lt;p&gt;Here's the simplest way I remember it:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;CSR asks the browser to build the page.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SSR asks the server to build the initial page.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Everything else — SEO, performance, loading experience, hydration — follows from this fundamental difference.&lt;/p&gt;




&lt;h1&gt;
  
  
  Let's Compare Them
&lt;/h1&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;&lt;/th&gt;
&lt;th&gt;CSR&lt;/th&gt;
&lt;th&gt;SSR&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Initial HTML&lt;/td&gt;
&lt;td&gt;Mostly empty shell&lt;/td&gt;
&lt;td&gt;Contains page content&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Rendering happens&lt;/td&gt;
&lt;td&gt;Browser&lt;/td&gt;
&lt;td&gt;Server&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Initial load&lt;/td&gt;
&lt;td&gt;Can be slower&lt;/td&gt;
&lt;td&gt;Usually faster for content&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;JavaScript dependency&lt;/td&gt;
&lt;td&gt;High&lt;/td&gt;
&lt;td&gt;Still required for interactivity&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;SEO&lt;/td&gt;
&lt;td&gt;More challenging&lt;/td&gt;
&lt;td&gt;Generally better&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Server workload&lt;/td&gt;
&lt;td&gt;Lower&lt;/td&gt;
&lt;td&gt;Higher&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Interactivity&lt;/td&gt;
&lt;td&gt;Excellent&lt;/td&gt;
&lt;td&gt;Excellent after hydration&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Best for&lt;/td&gt;
&lt;td&gt;Dashboards, apps&lt;/td&gt;
&lt;td&gt;Content-heavy pages&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h1&gt;
  
  
  🚀 What About SEO?
&lt;/h1&gt;

&lt;p&gt;This is one of the biggest reasons SSR became popular.&lt;/p&gt;

&lt;p&gt;Search engines need to understand your content.&lt;/p&gt;

&lt;p&gt;Consider a blog page.&lt;/p&gt;

&lt;p&gt;With CSR, the initial HTML might look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&lt;/span&gt; &lt;span class="na"&gt;id=&lt;/span&gt;&lt;span class="s"&gt;"root"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The actual article content appears only after JavaScript executes.&lt;/p&gt;

&lt;p&gt;With SSR, the initial HTML can already contain:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Understanding Distributed Systems&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;
Distributed systems are...
&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A crawler can immediately see meaningful content.&lt;/p&gt;

&lt;p&gt;This makes SSR a natural fit for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Blogs&lt;/li&gt;
&lt;li&gt;News websites&lt;/li&gt;
&lt;li&gt;E-commerce product pages&lt;/li&gt;
&lt;li&gt;Documentation&lt;/li&gt;
&lt;li&gt;Marketing websites&lt;/li&gt;
&lt;li&gt;Public-facing pages&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  But Wait — Is SSR Always Better?
&lt;/h2&gt;

&lt;p&gt;No.&lt;/p&gt;

&lt;p&gt;And this is where many tutorials oversimplify the topic.&lt;/p&gt;

&lt;p&gt;If SSR were always better, we wouldn't need CSR.&lt;/p&gt;

&lt;p&gt;Imagine a dashboard:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/dashboard
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The page contains:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Charts&lt;/li&gt;
&lt;li&gt;Filters&lt;/li&gt;
&lt;li&gt;Tables&lt;/li&gt;
&lt;li&gt;Drag-and-drop components&lt;/li&gt;
&lt;li&gt;Real-time notifications&lt;/li&gt;
&lt;li&gt;User-specific data&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Almost everything depends on the current user's interaction.&lt;/p&gt;

&lt;p&gt;Do you really need the server to generate every version of that UI?&lt;/p&gt;

&lt;p&gt;Probably not.&lt;/p&gt;

&lt;p&gt;A client-rendered dashboard can make perfect sense.&lt;/p&gt;

&lt;p&gt;# 🧠 A Real-World Example&lt;/p&gt;

&lt;p&gt;Imagine you're building an online learning platform.&lt;/p&gt;

&lt;p&gt;You have:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/
├── Home
├── Courses
├── Course Details
├── Dashboard
├── Profile
└── Settings
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Would you render everything the same way?&lt;/p&gt;

&lt;p&gt;Probably not.&lt;/p&gt;

&lt;h3&gt;
  
  
  Home
&lt;/h3&gt;

&lt;p&gt;Mostly public content.&lt;/p&gt;

&lt;p&gt;→ SSR / SSG can be useful.&lt;/p&gt;

&lt;h3&gt;
  
  
  Course Details
&lt;/h3&gt;

&lt;p&gt;Public and SEO-friendly.&lt;/p&gt;

&lt;p&gt;→ SSR / SSG can be useful.&lt;/p&gt;

&lt;h3&gt;
  
  
  Dashboard
&lt;/h3&gt;

&lt;p&gt;Highly personalized.&lt;/p&gt;

&lt;p&gt;→ CSR can be a great choice.&lt;/p&gt;

&lt;h3&gt;
  
  
  Settings
&lt;/h3&gt;

&lt;p&gt;Private and interactive.&lt;/p&gt;

&lt;p&gt;→ CSR is often reasonable.&lt;/p&gt;

&lt;p&gt;The important lesson is:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;A modern application doesn't have to choose only one rendering strategy.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;You can use different strategies for different pages.&lt;/p&gt;




&lt;h1&gt;
  
  
  ⚡ Where Does Next.js Come In?
&lt;/h1&gt;

&lt;p&gt;This is one of the reasons Next.js is so interesting.&lt;/p&gt;

&lt;p&gt;Instead of forcing developers into:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Everything = CSR
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Everything = SSR
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next.js gives you multiple rendering strategies.&lt;/p&gt;

&lt;p&gt;Depending on the architecture and version, you can work with concepts such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Server-side rendering&lt;/li&gt;
&lt;li&gt;Static generation&lt;/li&gt;
&lt;li&gt;Incremental regeneration&lt;/li&gt;
&lt;li&gt;Client-side rendering&lt;/li&gt;
&lt;li&gt;React Server Components&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So instead of asking:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"SSR or CSR?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;the better question becomes:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"What rendering strategy makes sense for this particular part of my application?"&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;




&lt;h1&gt;
  
  
  🔥 The Biggest Misconception
&lt;/h1&gt;

&lt;p&gt;One thing I wish I had understood earlier:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;SSR does not mean the entire application runs on the server.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;And:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CSR does not mean there is no server.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Both applications still have servers.&lt;/p&gt;

&lt;p&gt;Both can have APIs.&lt;/p&gt;

&lt;p&gt;Both can use databases.&lt;/p&gt;

&lt;p&gt;Both can use JavaScript.&lt;/p&gt;

&lt;p&gt;The main difference is &lt;strong&gt;where the initial UI rendering happens.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That distinction makes the whole topic much easier to understand.&lt;/p&gt;




&lt;h1&gt;
  
  
  So, Which One Should You Use?
&lt;/h1&gt;

&lt;p&gt;Here's my practical rule of thumb.&lt;/p&gt;

&lt;h3&gt;
  
  
  Choose SSR when:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The page is public.&lt;/li&gt;
&lt;li&gt;SEO matters.&lt;/li&gt;
&lt;li&gt;Initial content should appear quickly.&lt;/li&gt;
&lt;li&gt;The content is generated from server-side data.&lt;/li&gt;
&lt;li&gt;You want search engines to easily understand the page.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Choose CSR when:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;The page is highly interactive.&lt;/li&gt;
&lt;li&gt;SEO isn't important.&lt;/li&gt;
&lt;li&gt;The content is heavily personalized.&lt;/li&gt;
&lt;li&gt;Most of the work happens after user interaction.&lt;/li&gt;
&lt;li&gt;You're building dashboards or application-like interfaces.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And in many real applications?&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use both.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;That's usually the better answer.&lt;/p&gt;




&lt;h1&gt;
  
  
  Final Thought
&lt;/h1&gt;

&lt;p&gt;SSR vs CSR isn't really a battle.&lt;/p&gt;

&lt;p&gt;It's a design decision.&lt;/p&gt;

&lt;p&gt;The interesting question isn't:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"Which one is better?"&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It's:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;"Which one is better for this page, this user, and this application?"&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Once you start thinking that way, rendering stops being a collection of confusing acronyms.&lt;/p&gt;

&lt;p&gt;It becomes an architectural decision.&lt;/p&gt;

&lt;p&gt;And that's the part that actually matters.&lt;/p&gt;




&lt;h2&gt;
  
  
  📌 Quick Mental Model
&lt;/h2&gt;

&lt;p&gt;If you remember only one thing from this article:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;CSR
Browser → JavaScript → Data → UI

SSR
Server → Data → HTML → Browser → Hydration
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's the foundation.&lt;/p&gt;

&lt;p&gt;Everything else builds on top of it.&lt;/p&gt;

</description>
      <category>frontend</category>
      <category>nextjs</category>
      <category>react</category>
    </item>
    <item>
      <title>Hey Community .</title>
      <dc:creator>koushik Hazra</dc:creator>
      <pubDate>Sat, 12 Sep 2026 17:22:40 +0000</pubDate>
      <link>https://dev.to/koushik_hazra_49067f40231/hey-community--28h6</link>
      <guid>https://dev.to/koushik_hazra_49067f40231/hey-community--28h6</guid>
      <description>&lt;p&gt;Today i joined dev.to. And this is my first Post . &lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
