Support a pattern like Vary
for ISR (opt-out of dynamic rendering)
#58303
Unanswered
amannn
asked this question in
App Router
Replies: 1 comment
-
It's now possible to customize |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
From the data fetching caching docs:
Over time, I ran into some cases where a route opts into dynamic rendering, disabling the
cache-control
response header.Examples:
x-auth
authorization header to the app, which should be forwarded to API calls. This is different from a user-specific authorization header in that it is required for non-user-specific endpoints too. I understand that an environment parameter could be used in a similar way, this is mostly about being able to integrate with existing infrastructure.x-request-id
header that is passed to the app and needs to be forwarded to all API calls. In this case, the API calls might reach through multiple levels between services and the ID is important to group relevant logs.As soon as
headers().get(…)
is called, Next.js disables the full route cache.HTTP supports the Vary header to describe the headers that influence the response.
I'm wondering if something like this could be supported by Next.js too.
Example:
Alternatively, there could also be a list of explicitly allowed headers that don't influence the response.
See also: Understanding The Vary Header
Beta Was this translation helpful? Give feedback.
All reactions