How does SSR(Server-Side Rendering) differ from CSR(client-side rendering) ?
Last Updated :
09 Apr, 2025
Server-Side Rendering (SSR) and Client-Side Rendering (CSR) are two different approaches used in web development to render web pages to users. Each approach has its own set of advantages and disadvantages.
In this article, we will learn about the difference between SSR and CSR with examples and features.
Server-Side Rendering (SSR)
Server-side rendering is the process of rendering(loading) the web pages on the server side and sending the fully rendered HTML to the client. In this, the server generates HTML dynamically based on the requested URL and data then sends it to the client.
Features:
- It reduces the time to load initial page by delivering pre-rendered HTML directly to the client.
- Search engines can easily crawl and index pages rendered on the server side.
- It is rendered on server side so users can see content quicker, especially on slower connections or devices.
- It ensures that basic content is available to users even if JavaScript is disabled or fails to load.
- Devices with limited processing power benefit from SSR as it reduces the amount of client-side computation required to render the page.
Client-Side Rendering (CSR)
Client side rendering is the process of rendering web pages on the client side using JavaScript after the initial HTML is loaded. In this, the browser loads a minimal HTML document then JavaScript retrieves data from the server and generates the HTML dynamically.
Features:
- It allows for dynamic content loading without refreshing the entire page.
- In this, the web applications can provide highly interactive user interfaces and create a complex interactions such as drag-and-drop, real-time updates etc..
- Once the initial page is loaded, subsequent interactions typically result in faster response times since only the necessary data is fetched from the server
- It allows us to do asynchronous data loading.
Steps to Initialize Node Application and install required modules
Step 1: Create a NodeJS application using the following command:
npm init -y
Step 2: Install required Dependencies:
npm i ejs express
The updated dependencies in package.json file will look like:
"dependencies": {
"ejs": "^3.1.9",
"express": "^4.19.2"
}
Folder Structure:

Example: The below example demonstrate the SSR and CSR.
HTML
<!-- File path: views/csr.js -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSR Example</title>
</head>
<body>
<h1 style="color: green;">GeeksForGeeks | Client Side Rendering</h1>
<button onclick="showData()">Show Data</button>
<div id="dataContainer"></div>
<script>
async function showData() {
const response = await fetch('/api/data');
const data = await response.json();
document.getElementById('dataContainer').innerText = JSON.stringify(data);
}
</script>
</body>
</html>
HTML
<!-- File path: views/ssr.js -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SSR Example</title>
</head>
<body>
<h1 style="color: green;">GeeksForGeeks | Server Side Rendering</h1>
<p>Data from the server: <%= JSON.stringify(data) %></p>
</body>
</html>
JavaScript
//File path: /index.js
const express = require('express');
const app = express();
const port = 3000;
app.set('view engine', 'ejs');
// Sample data object
const data = {
message: "Hello from the server!"
};
// SSR route
app.get('/ssr', (req, res) => {
res.render('ssr', { data });
});
// CSR route
app.get('/csr', (req, res) => {
res.render('csr');
});
// API endpoint to fetch data for CSR
app.get('/api/data', (req, res) => {
res.json(data);
});
app.listen(port, () => {
console.log(`Server running at http://localhost:${port}`);
});
To run the application use the following command
node index.js
Output: Now go to http://localhost:3000/ssr and http://localhost:3000/csr in your browser:

Difference between SSR and CSR
SSR | CSR |
---|
SSR stands for Server-Side Rendering | CSR stands for Client-Side Rendering |
It renders the page at server side | It renders the page at client side |
It is a more SEO friendly | It is a less SEO friendly |
User interactivity is Limited | User interactivity is Highly interactive |
It consumes the server resources | It consumes the client resources |
It gives better performance on low Powered Devices | It may not give better performance on low Powered Devices |
It may require more server resources to handle rendering tasks. | It doesn't require more server resources to handle rendering tasks. |
Similar Reads
Non-linear Components In electrical circuits, Non-linear Components are electronic devices that need an external power source to operate actively. Non-Linear Components are those that are changed with respect to the voltage and current. Elements that do not follow ohm's law are called Non-linear Components. Non-linear Co
11 min read
Spring Boot Tutorial Spring Boot is a Java framework that makes it easier to create and run Java applications. It simplifies the configuration and setup process, allowing developers to focus more on writing code for their applications. This Spring Boot Tutorial is a comprehensive guide that covers both basic and advance
10 min read
React Interview Questions and Answers React is an efficient, flexible, and open-source JavaScript library that allows developers to create simple, fast, and scalable web applications. Jordan Walke, a software engineer who was working for Facebook, created React. Developers with a JavaScript background can easily develop web applications
15+ min read
React Tutorial React is a powerful JavaScript library for building fast, scalable front-end applications. Created by Facebook, it's known for its component-based structure, single-page applications (SPAs), and virtual DOM,enabling efficient UI updates and a seamless user experience.Note: The latest stable version
7 min read
Class Diagram | Unified Modeling Language (UML) A UML class diagram is a visual tool that represents the structure of a system by showing its classes, attributes, methods, and the relationships between them. It helps everyone involved in a projectâlike developers and designersâunderstand how the system is organized and how its components interact
12 min read
Backpropagation in Neural Network Back Propagation is also known as "Backward Propagation of Errors" is a method used to train neural network . Its goal is to reduce the difference between the modelâs predicted output and the actual output by adjusting the weights and biases in the network.It works iteratively to adjust weights and
9 min read
3-Phase Inverter An inverter is a fundamental electrical device designed primarily for the conversion of direct current into alternating current . This versatile device , also known as a variable frequency drive , plays a vital role in a wide range of applications , including variable frequency drives and high power
13 min read
Polymorphism in Java Polymorphism in Java is one of the core concepts in object-oriented programming (OOP) that allows objects to behave differently based on their specific class type. The word polymorphism means having many forms, and it comes from the Greek words poly (many) and morph (forms), this means one entity ca
7 min read
CTE in SQL In SQL, a Common Table Expression (CTE) is an essential tool for simplifying complex queries and making them more readable. By defining temporary result sets that can be referenced multiple times, a CTE in SQL allows developers to break down complicated logic into manageable parts. CTEs help with hi
6 min read
What is Vacuum Circuit Breaker? A vacuum circuit breaker is a type of breaker that utilizes a vacuum as the medium to extinguish electrical arcs. Within this circuit breaker, there is a vacuum interrupter that houses the stationary and mobile contacts in a permanently sealed enclosure. When the contacts are separated in a high vac
13 min read