Replies: 2 comments 1 reply
-
|
IMHO the main problem is that this is very specific to your deployment target. Calling the database in middleware/proxy for every request could be very inefficient. On a simple Docker Deployment it might not make much of a difference, but on other platforms you would need some very low latency solution. On Vercel there is Edge Config, on AWS Lambda you would also want something that does not run on your Lambda origin but on Cloudfront, so probably a CF Function + CF KeyValueStore. These have size limits though. Or, make sure your Origin-generated Redirects are cached properly (and invalidated). Works on Cloudfront, on Vercel I'm not sure what the current situation is. Sadly, the current state is that you need to tightly couple your app and infra design decisions. The Deployment Adapters API seems like a move in the right direction, although I think it doest cover a solution for dynamic redirects yet. |
Beta Was this translation helpful? Give feedback.
-
|
Maybe a more pragmatic solution in your case might be to leave the the default locale unprefixed, and/or adjust the redirect slug generation to be aware of the locale segment. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I wonder if anyone has a solution for this: In the website template, a
<Redirects />component is used to handle user generated redirects (Redirects collection), but when using a multi-language site (with next-intl), the next-intl middleware is ran first,When I want to redirect
site.dev/page-1tosite.dev/page-2, the next-intl middleware runs first and redirectssite.dev/page-1tosite.dev/en/page-1.Has anyone tackled using next-intl with user generated redirects?
Beta Was this translation helpful? Give feedback.
All reactions