Pages are pre-built at build time for maximum performance. Best suited for Blogs, Docs, and Marketing sites with content that doesn't change frequently.
SSG uses async Server Components pre-rendered at build time. For dynamic routes like [id], use generateStaticParams() to generate all static pages at build.
// app/posts/[id]/page.tsx
export async function generateStaticParams() {
return fetch('https://api.example.com/posts').then(res => res.json());
}
export default async function PostPage({ params }: { params: Promise<{ id: string }> }) {
const { id } = await params;
const post = await fetch(`https://api.example.com/posts/${id}`).then(res => res.json());
return <article>{post.content}</article>;
}