Next.js Discord

Discord Forum

generateStaticParams for dynamic route handlers

Answered
West African Crocodile posted this in #help-forum
Open in Discord
West African CrocodileOP
I have to utilize nextjs as a reverse proxy for my content pages, but cannot use edge runtime (middleware) -> cannot use nextjs native rewrites. Now i am using a catch-all route handler that fetches my landing page for example and provides the html back as a rewritten response.

Since this is a dynamic route handler, static rendering / caching does not really work here. It would be helpful to statically cache these route handlers for certain paths during build, with the same mechanic that is being used on dynamic page route segments: generateStaticPaths
Answered by joulev
uhm you are asking for generateStaticParams for route.ts files right? that should already work though, im using that in prod
View full answer

5 Replies