How to get my Durable Object's location?

and is it possible to change the location?
8 Replies
zegevlier
zegevlier2y ago
Get your location can be done by fetching https://cloudflare.com/cdn-cgi/trace, it includes a colo field which will tell you where the DO is located As for moving, that's not possible. You'll need to create a new object (potentially with a location hint) to have that
Letho
LethoOP2y ago
oh, this api dosn't accept any param like DO id, so it means all the DOs created by my workers are in the same location?
kian
kian2y ago
It's not an API - it shows you request information, which in this case would show the colo where your DO is.
Letho
LethoOP2y ago
ok I see, that means if the DO creation process was trigger by my request, then it will created in that colo location right?
kian
kian2y ago
No - you need to request that endpoint inside of your Durable Object
Letho
LethoOP2y ago
oh I see, I will try it Hi kian, I got the location result, but where do they mean? colo=SEA colo=SJC colo=LAX
kian
kian2y ago
They're IATA codes for airports. Cloudflare's colos are identified by the nearest airport. LAX is Los Angeles International, for example.
Letho
LethoOP2y ago
I find it, thank you very much sir!

Did you find this page helpful?