Skip to content

Conversation

@icyJoseph
Copy link
Contributor

@icyJoseph icyJoseph commented Feb 11, 2026

Since this site is deployed to Vercel then:

Vercel's CDN already includes the Accept and Accept-Encoding headers as part of the cache key by default. You do not need to explicitly include these headers in your Vary header.

However, if you go to https://react.dev/reference/react and do:

fetch(window.location.href, {headers: {
    accept:'text/markdown'
}}).then(res=>res.text()).then(console.log)

And follow that with:

fetch(window.location.href).then(res=>res.text()).then(console.log)

You'll see that both return markdown. The network tab shows that the latter is read from disk. Reloading the page fetches fresh. This PR fixes that edge case, but in general, I think it is a good idea to be explicit about the Accept header being part of the cache key.

Deployment with this addition: https://react-dev-plum.vercel.app/learn - compare to what happens on react.dev

@rickhanlonii 🙏

@github-actions
Copy link

Size changes

Details

📦 Next.js Bundle Analysis for react-dev

This analysis was generated by the Next.js Bundle Analysis action. 🤖

This PR introduced no changes to the JavaScript bundle! 🙌

@icyJoseph icyJoseph marked this pull request as ready for review February 11, 2026 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant