Next.js Discord

Discord Forum

Will the cache for fetch() be separate when the headers are different?

Unanswered
Asian black bear posted this in #help-forum
Open in Discord
Asian black bearOP
I'd like to know if the cache will be different for fetch() with different headers. From looking at the code, it seems like headers are also used in generating the key. Can we trust this as the official behavior?
https://github.com/vercel/next.js/blob/31c2f976cdd4deb0e7c412538a70b795dff4689e/packages/next/src/server/lib/incremental-cache/index.ts#L374-L390

Also, is there a plan to add this information to the documentation in the future?

0 Replies