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