Support headers and cookies in getStaticPaths
#27352
eric-burel
started this conversation in
Ideas
Replies: 1 comment 2 replies
-
|
What a coincidence, I literally ran into that exact problem today. Saw this post and thought to myself that it was old and ignored. The big thing I would add, is that just like you said, theres an issue of exponential routes and therefore pages to render. |
Beta Was this translation helpful? Give feedback.
2 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.
-
Describe the feature you'd like to request
Hi, this ticket is a follow up on multi-tenancy discussions (#20841, #17260, https://blog.smallcase.com/scaling-microsite-with-next-js/) and more generic discussions I've opened about static rendering and ISR for personnalizaed and private content (#17631, https://blog.vulcanjs.org/lets-bring-the-jamstack-to-saas-introducing-rainbow-rendering-ad1834fe62ff). This is also tightly related to i18n routing, as it proposes an alternative not based on routes.
It seems to me that SSG and ISR could be made drastically more powerful by supporting
cookiesandheadersparameters in addition to route parameters.Pro:
foobar.com/en/my-pagedoes not scale beyond i18n, and feels really weird in many contexts. There are already headers for that, being forced into using route params seems a regression.Cons:
This is already an issue with SSG as is anyway, and Next.js has proven able to handle an infinite number of pages thanks to ISR.
Describe the solution you'd like
Example usage:
This might not be the smartest approach but you get the point: somehow allowing user to rely on headers and cookies in this function.
This could be similar to the syntax used in redirects already, with
has.Describe alternatives you've considered
In the end, SSR feels more complicated than it would be to learn using an extended version of
getStaticPathsBeta Was this translation helpful? Give feedback.
All reactions