Data Fetching in Next.js
Click the strategies to navigate
SSG: Static-site generation
Runs once at build-time - reused for each request
19:32:52
SSR: Server-side rendering
Runs on every request - fetch data before sending page to client
19:32:52
CSR: Client-side rendering
Runs on every request - load page first and fetch data on client-side (loading... => data)
19:32:52
ISR: Incremental Static Regeneration
SSG and SSR combined - update data after a certain revalidation time (7 seconds)
19:32:52
to see changes
Erik Streller 2024 • Source Code