Specific location
Is there a way to invoke a Worker in a specific data center?
Eg: for uptime monitoring from different locations around the world
4 Replies
You have a few options:
1) Smart Placement. You don't get to pick where it spawns, it depends on your origin(so not very useful to you)
2) Durable Objects. You can hint them to a region, or spawn them from a specific colo manually(if you can consistently hit them from that DC, or with something like https://colo.do/). Note too that this doesn't apply to every datacenter.
3) Health Checks/Load Balancer Health Checks. This requires an Enterprise plan to run from every DC/specific cities, but it is probably the best option, should you be willing to pay.
I see, so creating a few DOs with the region hinted will make sure they are always in that region so if I call my worker and invoke that DO I can do the uptime fetch in the DO itself
Yes and for health checks theres an example here which uses region hints https://github.com/Tyler-OBrien/workers-health-checks
GitHub
GitHub - Tyler-OBrien/workers-health-checks: Workers Health Checks ...
Workers Health Checks in D1 & AE w/ CF Workers. Contribute to Tyler-OBrien/workers-health-checks development by creating an account on GitHub.
probably not exactly your thing but would serve as an example of how that can be done