Performance: Why rendering strategy matters
HIGH IMPACT
Rendering strategy affects how fast the main content appears and how quickly users can interact with the page.
export async function getStaticProps() { const data = await fetch('https://api.example.com/data').then(res => res.json()); return { props: { data } }; } export default function Page({ data }) { return <div>{data.title}</div>; }
export default async function Page() { const data = await fetch('https://api.example.com/data').then(res => res.json()); return <div>{data.title}</div>; }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Client-side data fetching | Many (delayed DOM update) | Multiple (due to late content injection) | High (delayed paint) | [X] Bad |
| Server-side or static rendering | Few (immediate DOM ready) | Single (initial layout) | Low (fast paint) | [OK] Good |