Closed gustaveWPM closed 11 months ago
Sorry, I missed this issue. Next.js recommends to use this pattern in their documentation, so I simply did the same: https://nextjs.org/docs/app/building-your-application/routing/middleware#matcher
I don't think there is any noticeable performance difference between the two solutions. The one in the docs might just be easier to understand, as paths are written directly.
Hello,
From the doc:
https://next-international.vercel.app/docs/app-setup#setup-middleware
Why not just:
I don't understand why the
favicon.ico
androbots.txt
patterns are hard-coded.It's more of a question than a suggestion. I'm completely hopeless with RegEx: I don't understand anything about it. I'd be curious to know which technical reason makes it better practice to chain hard-coded values.
Is it related to a performance issue, like the fact that a generic RegEx would lead to greater algorithmic complexity? I doubt it very much. So what's the reason?