Third-party cache provider #83438
alessiofrittoli
started this conversation in
Ideas
Replies: 1 comment 3 replies
-
Oh this was a much needed discussion I think. There's info spread all around from people who has problems with Vary, etc... So is the guidance that, one should bypass CDN if the Accept header is I'll ask some team members too, but would like to see opinions from people who have gone through this. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
Non-Goals
No response
Background
I'm serving a Next.js web app through a CDN with cache policy enabled. The CDN is completely ignoring URL search parameters so I'm unable to serve un-cached result when
/**/*?_rsc={someKey}
is requested during client-side navigation.This is causing hard-reloads since requests made with the
_rsc
are not receivingtext/x-component
response type but the cachedtext/html
rendered content instead.I noticed that an
RSC
request header is being set when/**/*?_rsc={someKey}
is requested during client-side navigation, so I'm not pretty sure if that request header could be actually used as cache key in the CDN cahce policy configuration in order to return a non-cached version, thus returningtext/x-component
as Next.js expects.Proposal
Could be nice to have a dedicated section in the Caching Guide of the official Next.js doc website that documents about parameters or Request Headers that could be used as cache key in a third-party cache policy provider.
Related issue
Discord forum Post
Beta Was this translation helpful? Give feedback.
All reactions