Performance: Static rendering (default)
HIGH IMPACT
Static rendering impacts the initial page load speed by pre-building HTML at build time, reducing server work and speeding up content delivery.
export async function getStaticProps() { const res = await fetch('https://api.example.com/data'); const data = await res.json(); return { props: { data } }; } export default function Page({ data }) { return <div>{data.title}</div>; }
export async function getServerSideProps() { const res = await fetch('https://api.example.com/data'); const data = await res.json(); return { props: { data } }; } export default function Page({ data }) { return <div>{data.title}</div>; }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Server-side rendering on each request | High (dynamic DOM) | Multiple per request | High due to delayed HTML | [X] Bad |
| Static rendering at build time | Low (static DOM) | None at runtime | Low, instant paint | [OK] Good |