Performance: Revalidation strategies (time-based)
MEDIUM IMPACT
This affects how often the page content is refreshed and how fast users see updated content without blocking the initial load.
export async function getStaticProps() { const data = await fetchData(); return { props: { data }, revalidate: 60 // Rebuild page in background every 60 seconds }; }
export async function getStaticProps() { const data = await fetchData(); return { props: { data } }; } // No revalidation, page rebuilds only at deploy time
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| No revalidation (static only) | Minimal DOM nodes | 0 reflows on load | Fast paint but stale content | [!] OK |
| Time-based revalidation (e.g., 60s) | Minimal DOM nodes | 0 reflows on load | Fast paint with fresh content over time | [OK] Good |