Why this matters
The production reason.
Not every page needs live data on every request. Revalidation lets content stay fast while still updating on a predictable interval.
Use short windows for pricing or dashboards, longer windows for blog posts, docs, and tool landing pages.
This avoids rebuilding the entire site just because one data source changes.
async function getPosts() {
const res = await fetch("https://cms.example.com/posts", {
next: { revalidate: 900 },
});
if (!res.ok) throw new Error("Unable to load posts");
return res.json();
}