- Static rendering: render lúc build time, cache và serve từ CDN.
- Dynamic rendering: render mỗi request, không cache.
Tự động dynamic khi dùng: await cookies(), await headers(), searchParams, hay fetch với cache: 'no-store'. Explicit: export const dynamic = 'force-dynamic' hoặc 'force-static'. Opt-in static càng nhiều càng tốt cho performance.
- Static rendering: happens at build time, cached and served from a CDN.
- Dynamic rendering: happens per request, not cached.
A route becomes dynamic automatically when it uses: await cookies(), await headers(), searchParams, or fetch with cache: 'no-store'. Be explicit with export const dynamic = 'force-dynamic' or 'force-static'. Prefer static rendering whenever possible for best performance.