How to execute an Edge Function in a particular region.
Edge Functions are executed in the region closest to the user making the request. This helps to reduce network latency and provide faster responses to the user.
However, if your Function performs lots of database or storage operations, invoking the Function in the same region as your database may provide better performance. Some situations where this might be helpful include:
- Bulk adding and editing records in your database
- Uploading files
Supabase provides an option to specify the region when invoking the Function.
x-region HTTP header when calling an Edge Function to determine where the Function should be executed:
You can verify the execution region by looking at the
x-sb-edge-region HTTP header in the response. You can also find it as metadata in Edge Function Logs.
These are the currently supported region values you can provide for
Handling regional outages#
If you explicitly specify the region via
x-region header, requests will NOT be automatically re-routed to another region and you should consider temporarily changing regions during the outage.