Next.js Discord

Discord Forum

Edge middleware running in a far away region

Unanswered
io posted this in #help-forum
Open in Discord
ioOP
I have a project where a edge middleware redirects unauthenticated users.

The middleware runs before the serverless function, but they’re run in a different region from the serverless function, which increases latency.

Is this normal behavior, or is there a solution to this issue?

Here’s a screenshot of the log page:


Here you can see that the edge middleware runs in Singapore, which is different from the serverless function.

My understanding was that edge functions run in the closest region to the user. I’m located in Seoul, so I expected the middleware to run in icn1, which is the closest region.

Thank you in advance.

0 Replies