CodePark/ questions / Data fetching & caching
START PRACTICINGPRACTICE
Frontend question · Next.js › Data fetching & caching

In Next.js 15, a page calls await fetch("https://api.example.com/posts") with no options and uses no other dynamic APIs. What happens in production?

The result is not stored in the Data Cache, but the route is still prerendered at build time, so the data is baked into the static page

The result is not stored in the Data Cache, but the route is still prerendered at build time. In Next.js 15 fetch is uncached by default. That alone does not make the route dynamic. Without dynamic APIs (request-time APIs like cookies() or searchParams), the page is prerendered once at build time, so the data is baked in. The tempting "The fetch runs on every request" is wrong for that reason. To cache, opt in with cache: "force-cache" or next.revalidate. To force request-time rendering, call connection().