Is preferredRegions just a priority list? #4285
SummaryHi, I'm trying to make an edge runtime function that reads the region it is executing in, using the x-vercel-id header. While doing this, I found an unexpected behaviour. I set my preferred regions to ['fra1', 'cle1']. Then I used a VPN in San Fransisco, and the header read sfo1::fra1. This indicated that the closest region is sfo1, which is not in my preferred regions array, so it just selected the first one in the array instead. I thought that the config would select the closest region in the array, not the first one if it's not a direct hit. Am I doing something wrong, or is this how it actually works? If it is, it seems like a priority list. ExampleNo response Steps to ReproduceDescribed in the summary. |
Replies: 4 comments 7 replies
|
With Edge Functions, visitors automatically use the region that is geographically closest to them. You can set the There are also over 100 points of presence (POPs) in front of our compute-capable regions. Traffic to Vercel is routed to these POPs, and then from the POPs to the nearest region to get traffic to and from the Vercel Edge Network as quickly and efficiently as possible. The following pages have much more information about our Edge Network: |
|
@amyegan @kasperaamodt are there any updates about this one? I've also noticed that it works similarly to a priority list instead of actually routing to the nearest region from the list. |
|
@matannahmani @kasperaamodt We're rolling out a fix this week to support specifying multiple regions for edge functions, so they work as you expect. |
|
This configuration does not work as expected when used with ENV variables. I set the variable to an array of ['sin1', 'hnd1'] (with parsing from string 'sin1,hnd1' of course) but it still routes to hkg1. Hard coding works, but this should be fixed or changed as OpenAI is going to block requests from hkg1. |




@matannahmani @kasperaamodt We're rolling out a fix this week to support specifying multiple regions for edge functions, so they work as you expect.