Once a DO is created, it does not move.
Once a DO is created, it does not move. I check where a DO is by fetching a
/cdn-cgi/trace
, then seeing the colo field10 Replies
maybe I miss something but is this endpoint kind of automatic on the DO ?
https://durable-object/cdn-cgi/trace
No, it is a fetch call you make from within the Worker. See https://github.com/helloimalastair/where-durableobjects-live/blob/main/apps/worker/src/DO.ts
GitHub
where-durableobjects-live/apps/worker/src/DO.ts at main · helloimal...
Tracking where Durable Objects are created, wherever you are in the world. - helloimalastair/where-durableobjects-live
ha I see
ok
would it be correct to do the same approach to know where the worker is running?
right now I did it within the DO, it seems to work, I suppose from within the worker it should work too ?
Assuming it is a Worker handling an incoming fetch request, I would just get the colo from
request.cf.colo
Then you don't have to do a fetch
call at allok so first big thanks, for the
colo
in the DO, I can see my DO is in SJC (currently in France, 140ms is more than ok) 🙂
I don't see any cf.colo
in the request on the worker though
that's the CF headers I getIt's not in the headers, it is on the Request object itself
Like:
oh I need to see if I have that in Hono
yes 🙂 modulo some types missing right away
You can also see here: https://where.durableobjects.live