SSR now and SSR (aka templating) 10 y ago?
- User
SSR now and SSR (aka templating) 10 y ago?
- Assistant
Great question — SSR (Server-Side Rendering) today vs. 10 years ago (when it was mostly about templating engines) has changed quite a bit in terms ofpurpose,tooling, andcomplexity. Here's a comparison:
SSR / Templating ~10 Years Ago
Examples:PHP, Ruby on Rails (ERB), (Jinja2), Express with EJS/Pug/Handlebars
How it worked:Server generated full HTML pages using template engines and sent them to the browser.
Use case:Pretty much everything—blogs, dashboards, e-commerce.
Interactivity:JavaScript was used sparingly (jQuery, inline scripts).
Strengths:Simple mental model (request → render HTML → send).SEO-friendly out of the box.Easy to debug.
Simple mental model (request → render HTML → send).
SEO-friendly out of the box.
Easy to debug.
Limitations:Less interactive UI.Page reloads on every navigation.Limited client-side state management.
Less interactive UI.
Page reloads on every navigation.
Limited client-side state management.
How it worked:Server generated full HTML pages using template engines and sent them to the browser.
Use case:Pretty much everything—blogs, dashboards, e-commerce.
Interactivity:JavaScript was used sparingly (jQuery, inline scripts).
Strengths:
Simple mental model (request → render HTML → send).
SEO-friendly out of the box.
Easy to debug.
Simple mental model (request → render HTML → send).
SEO-friendly out of the box.
Easy to debug.
Limitations:
Less interactive UI.
Page reloads on every navigation.
Limited client-side state management.
Less interactive UI.
Page reloads on every navigation.
Limited client-side state management.
SSR Now (2020s)
Examples:Next.js, Nuxt.js, Remix, SvelteKit
How it works:Still generates HTML on the server,but now it's often part of an isomorphic (universal) appwhere the same code runs on both client and server. Often includes hydration.
Use case:SPAs with SEO, fast TTFB, hybrid rendering (some SSR, some static, some client-only).
Interactivity:Full rehydration of components for client-side interactivity.
Strengths:Combines benefits of SPAs and SSR.Faster first load (TTFB) + rich interactivity.Fine-grained rendering control (e.g., server components in React).
Combines benefits of SPAs and SSR.
Faster first load (TTFB) + rich interactivity.
Fine-grained rendering control (e.g., server components in React).
Limitations:More complex stack and mental model.Requires bundlers (Webpack, Vite), routing frameworks.Hydration can be expensive and glitchy if not done carefully.