Understanding CSR, SSR, SSG, and ISR: A Quick Guide
When building websites, one of the most important decisions is how your pages are rendered. Rendering determines how and when the content is displayed to users, and it can impact performance, SEO, and user experience. Let's break down the four main types:
1. CSR – Client-Side Rendering
In Client-Side Rendering (CSR), the browser downloads a mostly empty HTML page and uses JavaScript to build the content.
2. SSR – Server-Side Rendering
Server-Side Rendering (SSR) generates the page on the server for every request. The browser receives a fully rendered HTML page.
getServerSideProps.3. SSG – Static Site Generation
With Static Site Generation (SSG), pages are built ahead of time, usually at build time, and served as static files.
getStaticProps.4. ISR – Incremental Static Regeneration
Incremental Static Regeneration (ISR) is a hybrid approach. It lets static pages update after deployment without rebuilding the entire site.
revalidate option with getStaticProps.Quick takeaway: