Performance: Opting out of caching
HIGH IMPACT
This affects page load speed and server response time by disabling cache reuse, causing repeated data fetching or rendering.
export const revalidate = 60; export default async function Page() { const res = await fetch('https://api.example.com/data', { next: { revalidate: 60 } }); const data = await res.json(); return <div>{data.value}</div>; }
export const revalidate = 0; export default async function Page() { const res = await fetch('https://api.example.com/data', { cache: 'no-store' }); const data = await res.json(); return <div>{data.value}</div>; }
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| No caching (revalidate=0) | Same DOM nodes each request | Multiple reflows due to delayed HTML | Higher paint cost due to slower load | [X] Bad |
| Caching enabled (revalidate>0) | Same DOM nodes reused | Single reflow on initial load | Lower paint cost due to faster load | [OK] Good |