ghost_dev's avatar

How to have dynamic redirect URLs in Next.js 13?

I have developed application in nextjs 13. I want to implement dynamic URLs redirect in nextjs.

The list of URLs will come from API. One solution I found is to use middleware by fetching the list of URLs from AP and then performing redirection if URL matches...but this is not ideal solution as redirect URLs API will be called on every request.

Is there any way to fetch API list on initial website load and then store it somewhere and we can use them in middleware on every request Can anyone suggest me some solutions

0 likes
0 replies

Please or to participate in this conversation.