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.
Yes, from my understanding, this is expected behavior. Edge Middleware and Serverless Functions can run in different regions and operate independently.
In your case, Singapore (sin1) is geographically close to Seoul and was likely chosen based on network conditions to deliver optimal performance at that time. Middleware doesn’t need to run in the same region as your Serverless Function because they serve different purposes: middleware handles request processing and routing, while serverless functions run your application logic.