URLs mapped to server functions, not static files
Data fetched from data sources and used to generate HTML dynamically
SEO Optimized for web crawlers (e.g., Google Bot)
Initial Minimal HTML
Client-side rendering with JS
Dynamic DOM manipulation
on the user's browser
Enabled by AJAX:
asynchronous data fetching
App-like user experience
Consistent navigation
without full page reloads
Disadvantages:
Poor initial SEO due to empty initial HTML
Longer Time-to-Interaction (TTI): JS must load, execute, and fetch data first
JavaScript "hydrates" the UI once loaded
After hydration, the app behaves like an SPA
JS attaches event handlers and interactivity to static HTML
Combining the advantages of SSR and SPA
Static pages generated at build-time initially
Pages regenerated incrementally on demand
Regeneration triggered by:
Set revalidation time interval
User request after stale data
Benefits:
Keeps static pages up-to-date
Maintains speed of
static generation with
dynamic content updates
Specific to Next.js
SSG:
Fastest initial load, optimal SEO, static
SSR:
Dynamic data, optimal SEO,
server-generated
SPA:
Rich user experience, SEO,
and initial load challenges
Hybrid & ISR:
Balance static speed with
dynamic flexibility