denoland / denoland/deploy_feedback

Send request to specific region

Open
#127 8 comments 22 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
79
Forks
5
PR merge metrics
No merged PRs in 30d

Description

Currently, a request to a Worker (pending name #105) is automatically routed to the instance in the best region which is usually the closest. It might be useful to be able to specify an instance in a specific region in the request [^cdnplanet] [^cf]. Note, this is different from deploying the Worker only to specific regions in the first place, see #93.

One option could be to use the URL. To not interfere with the API of the Worker which can access the path, a subdomain could be used, e.g. `..deno.dev`. If no `` subdomain is given it uses the default routing like right now.

But if in the future more settings are added this would prove cumbersome since in a URL the order of subdomains is fixed and for any subdomain all previous subdomains have to be set, e.g. `..`. Likely there aren't many more settings for Workers, but there is already one for Coordinators (#88) which uses a subdomain for a duplicate Coordinator.

A better option could be to use a custom HTTP header, e.g. `X-Deno-Deploy: region=`. The header would be filtered out at the Deno Deploy edge and not be visible to the Worker that receives the request. The advantage of key-value pairs in a header is that the order is not fixed and any one can be left out. The advantage is similar to using a single object as function argument instead of named arguments.

[^cdnplanet]: https://www.cdnplanet.com/blog/our-cloudflare-workers-kv-wishlist/#3
[^cf]: https://community.cloudflare.com/t/is-it-possible-to-trigger-a-worker-on-a-specific-geographic-region/25175

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the proposed URL and HTTP-header approaches, along with related issues #105, #93, and #88. Done means a request can select a specific region, requests without that selection retain default routing, and the chosen mechanism does not expose routing settings to the Worker.

Written by the indexing model from the issue text.

Assessment

Tech stack
deno
Domain
backend-api-design, cloud, networking
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.