Performance: Static vs server-side data fetching
HIGH IMPACT
This concept affects how fast the main content appears and how quickly the page responds to user interactions.
--- export const prerender = true; const res = await fetch('https://api.example.com/posts/1'); const post = await res.json(); --- <article>{post.title}</article>
--- export const prerender = false; const res = await fetch('https://api.example.com/posts/1'); const post = await res.json(); --- <article>{post.title}</article>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Static data fetching | Minimal - pre-built DOM | 0 on load | Fast paint with ready HTML | [OK] Good |
| Server-side data fetching | Minimal but delayed DOM creation | 0 on load but delayed | Paint delayed until data arrives | [X] Bad |