Vary header CDN issues #80107
Unanswered
6TELOIV
asked this question in
App Router
Replies: 0 comments
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.
-
Similar to this pr and comment, we ran into issues with the Vary headers and our CDN. In particular, Akamai will skip caching entirely for any response including a
Vary
header besidesAccept-Encoding
. The presense of the_rsc
param ensures that caches won't server INVALID responses, but the remaining presense of theVary
header at all causes incachability in this case.Ideally, there would be a way in NextJS to disable the
Vary
headers, as they seem to have been superseeded by the_rsc
query params and are not strictly necessary to be present in the response exiting the server. I see that they are used within some internal code for in-memory cache validation, so flat-out removing all references seems like a no-go. Instead, I think a flag in next.config is appropriate, which would simply remove the header at the last moment before sending a response.Addtionally, it would be extremely helpful for these default headers to be documented at a minimum. I belive the CDN portion of self hosting may be an appropriate location: https://nextjs.org/docs/app/guides/self-hosting#usage-with-cdns
Beta Was this translation helpful? Give feedback.
All reactions