Use generateStaticParams for App Router or getStaticProps/getStaticPaths for Pages Router. Pages are built at build time. Support static data fetching. Content cached and reused.
Fastest page loads, better SEO, reduced server load, improved security. Pages can be served from CDN. Support global deployment. Lower hosting costs.
Place assets in public directory. Support automatic optimization. Handle asset references. Implement asset management strategies.
Use client-side fetching for dynamic data. Implement hybrid approaches. Support progressive enhancement. Handle content updates.
Build only changed pages. Handle dependency tracking. Support incremental builds. Implement build optimization.
Define dynamic paths using generateStaticParams or getStaticPaths. Specify which paths to pre-render. Support fallback behavior. Handle path generation.
Fallback controls behavior for non-generated paths. Options: false (404), true (loading), or 'blocking' (SSR). Affects user experience and build time.
Implement path validation during build. Handle invalid paths. Support custom validation. Implement error handling for path generation.
Data fetched during npm run build. Available for static page generation. Support external data sources. Handle build-time operations.
Implement pagination or chunking. Handle build performance. Support incremental builds. Implement data management strategies.
Enable preview mode for draft content. Handle authentication. Support preview routes. Implement preview strategies.
Track build metrics and performance. Handle build analytics. Support debugging tools. Implement monitoring strategies.
Create comprehensive build documentation. Generate build reports. Support example configurations. Implement documentation updates.
SSG generates HTML at build time instead of runtime. Pages are pre-rendered and can be served from CDN. Provides fastest possible performance. Ideal for content that doesn't change frequently.
Fetch data during build using async components or getStaticProps. Data available at build time. Support external APIs. Handle build-time data requirements.
Use build cache for faster builds. Handle cache invalidation. Support incremental builds. Implement cache strategies.
Manage nested data relationships. Handle circular dependencies. Support data validation. Implement dependency resolution.