generateStaticSearchParams() #58181
Replies: 3 comments 2 replies
-
|
I think you can do this with rewrites... and by not allowing direct access to the "destination" file:
With the above, you can match requests with a given query param, and rewrite them to a destination, using the query param, as long as you capture it, as they mention in that document. Then you'd statically generate |
Beta Was this translation helpful? Give feedback.
-
|
+1 for this. The more general issue for me is not being able to have caching headers on any page that reads |
Beta Was this translation helpful? Give feedback.
-
|
Yeah having a option to generateStaticSearchParams would give even more life to the ISR |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently we have
generateStaticParams()to create dynamic segments and generate pages at build time.Often we want to store state in the url and I find that in many use cases we only need a few params with limited values.
For example I am building a page displaying articles, and I want to query them by date. Therefore I will only have a
datesearch param with the following values:2020, 2021, 2022, 2023.Since I am deciding ahead of time what values there could possibly be then it should be possible to:
Since currently this behavior is not available, could it be implemented? Is there a reason it might not be possible?
Beta Was this translation helpful? Give feedback.
All reactions