generateStaticParams pre-render dynamic routes tại build time (SSG) → HTML sẵn sàng, Google index ngay, TTFB cực nhanh.
Ví dụ: blog có 100 posts → generate 100 static HTML pages. ISR (Incremental Static Regeneration): kết hợp tốt nhất của SSG và SSR — serve cached HTML, background revalidate sau N giây. SEO benefits:
- Fast TTFB → Google crawl nhanh hơn
- HTML đầy đủ → index ngay không cần render JS
- Luôn fresh content với revalidate. Pattern:
generateStaticParamscho known routes (categories, popular posts), fallback dynamic rendering cho routes mới (long-tail). Vớirevalidate: 3600(1 giờ): Google luôn thấy content mới nhất, users luôn thấy fast page
generateStaticParams pre-renders dynamic routes at build time (SSG) — HTML is ready immediately, Google can index it right away, and TTFB is extremely fast.
Example: a blog with 100 posts generates 100 static HTML pages. ISR (Incremental Static Regeneration): combines the best of SSG and SSR — serves cached HTML while revalidating in the background after N seconds. SEO benefits:
- Fast TTFB → Google crawls faster
- Full HTML → indexed immediately without needing to render JS
- Always-fresh content with revalidation. Pattern: use
generateStaticParamsfor known routes (categories, popular posts) and fallback to dynamic rendering for new routes (long-tail). Withrevalidate: 3600(1 hour): Google always sees the latest content and users always get a fast page