SSG tạo HTML tại build time, serve static files từ CDN. Cực kỳ nhanh, không cần server processing mỗi request. Phù hợp cho: blog, documentation, marketing pages, data ít thay đổi. Pages Router: không có getServerSideProps. App Router: dùng export const dynamic = 'force-static'.
Nhược điểm: phải rebuild để cập nhật content.
SSG generates HTML at build time and serves static files from a CDN.
- It is extremely fast with no per-request server processing.
- Best for: blogs, documentation, marketing pages, and data that changes infrequently.
- In the App Router use
export const dynamic = 'force-static'. - Downside: you must rebuild to update content.