Next.js wraps the server fetch in a memoization layer scoped to one React render, so the same data can be fetched where it's used instead of passed down through props.
Two calls share one network request when all of these hold:
- they run in the same render: Server Components, layouts, pages,
generateMetadataand, per the docs,generateStaticParamsandgenerateViewportin that request; - the method is
GET(the source also allowsHEAD); - no
signalis passed (nor, per the source,keepalive); - URL and headers match; the source's key also includes
mode,redirect,credentials,referrer,referrerPolicyandintegrity.
Per the source (the HEAD, keepalive and extra-field rules not run here), the second caller gets a clone of the first response, so each can read the body.
They are not deduplicated when:
- a header value differs (
x-v: 1andx-v: 2made two requests, twox-v: 1calls one); - the method is
POST, even with identical bodies; - an
AbortControllersignal is passed: the documented opt-out; - the code runs in a route handler, which isn't part of the component tree;
- the calls belong to different requests: memoization ends with the render.
The key ignores the cache option. A plain fetch and a cache: 'no-store' fetch of the same URL made one request in 16.4.5, and the source says whichever ran first decides the caching. The docs' wording, "the same URL and options", suggests otherwise.
Memoization is separate from the data cache: it dedupes even uncached fetches, and stores nothing between requests. For database or SDK calls, wrap the function in React's cache for the same per-request dedup.