Performance: Metadata API (static metadata)
MEDIUM IMPACT
This affects the initial page load speed by providing metadata without runtime overhead.
export const metadata = { title: 'Static Page Title', description: 'Static description for SEO', };
export async function generateMetadata() { const res = await fetch('https://api.example.com/meta'); const data = await res.json(); return { title: data.title }; }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Runtime metadata fetch | No extra DOM nodes | 0 reflows | Blocks paint until data arrives | [X] Bad |
| Static metadata export | No extra DOM nodes | 0 reflows | No paint blocking, immediate metadata | [OK] Good |