You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
document all headers used by Next to make it easy for people who manage next behind a reverse proxy to pass the correct headers
Non-Goals
No response
Background
I was debugging server actions that didn't work in my Next app running in AWS behind CloudFront (CDN) until I finally discovered that it's because CloudFront strips all the headers except for those specified in caching policy. I tried looking up an exhaustive list of headers used by Next, but couldn't find one, so I had to settle with copying the headers actually sent with the Action request.
There's unfortunately no guarantee that these headers won't change in the future and I have no other way of finding out than deploying the app and see if it breaks. If they were documented, I could just check the docs and update my caching policy (or any other reverse proxy config).
Proposal
A new section in the docs with an exhaustive list of all the headers Next is using (not only the next-* ones, but also the ones that are, for example, used for determining whether the request can be served from cache). If making a list of all the headers would be too hard (or it'd be too hard to maintain), at least a list of headers that can break next if they're not forwarded would be nice.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
Non-Goals
No response
Background
I was debugging server actions that didn't work in my Next app running in AWS behind CloudFront (CDN) until I finally discovered that it's because CloudFront strips all the headers except for those specified in caching policy. I tried looking up an exhaustive list of headers used by Next, but couldn't find one, so I had to settle with copying the headers actually sent with the Action request.
There's unfortunately no guarantee that these headers won't change in the future and I have no other way of finding out than deploying the app and see if it breaks. If they were documented, I could just check the docs and update my caching policy (or any other reverse proxy config).
Proposal
A new section in the docs with an exhaustive list of all the headers Next is using (not only the
next-*
ones, but also the ones that are, for example, used for determining whether the request can be served from cache). If making a list of all the headers would be too hard (or it'd be too hard to maintain), at least a list of headers that can break next if they're not forwarded would be nice.Beta Was this translation helpful? Give feedback.
All reactions