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

2 messages · Page 1 of 1 (latest)

lavish linden
#

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?

GitHub

The React Framework. Contribute to vercel/next.js development by creating an account on GitHub.

true sphinxBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)