fullstackBy Zahid Khan

Difference b/w SSG+ISR vs SSR?

SSR renders the page on every request. SSG + ISR serves pre-built static pages and updates them periodically or on demand. 1️⃣ SSR – Server-Side Rendering How it works User requests a page Server runs code (DB/API calls) HTML is generated at request time HTML is sent to the browser Key characteristics Page is rendered on every request Database/API is called every time HTML is always fresh Pros Always up-to-date data Good for personalized or auth-based pages Cons Slower than SSG Higher server and DB load Limited CDN caching Best use cases Dashboards Admin panels User-specific pages Real-time data 2️⃣ SSG + ISR – Static Site Generation with Incremental Static Regeneration How it works Pages are generated at build time HTML is stored and served from CDN After a defined time (revalidate), the page is regenerated in the background New users get updated HTML without rebuilding the whole app Key characteristics Pages are static Extremely fast (CDN-served) Database is not called on every request Pros Very fast performance Excellent SEO Low server cost Scales easily Cons Data is not real-time Slight delay before updates appear Best use cases Blogs Marketing pages Documentation Portfolio websites
#reactjs#nextjs