If your device’s clock is set to the wrong time, it should tell you how far off the clock is set.
Why are we assuming that your HTTP-based method running in JS in a browser, using servers that are already distributed and time-synched with tech stacks that you have no insight into, is the “right time” and the directly NTP-synchronized clock of my machine is the “wrong time”?
Hey, author here. You’re asking a couple questions, which I’ll try to unpack.
You’re right to be suspicious that Cloudflare CDN servers have the right time. I tried to call out that concern in the post. Cloudflare operates time services, but their CDN is not a time service and wouldn’t be operated under the same controls. How accurate those servers are is an open question.
When writing the post I observed NTP client logs, a GPS-based clock, and the CDN-based clock report time that agreed within their stated error bounds. I’ve also seen NTP-synchronized and mobile network synchronized system clocks that fell outside the estimates of those other clocks. So it’s an “odd one out” situation.
Cool, thanks for taking a look! Do you know of any official reference for how the Cloudflare CDN server clocks are synced? I looked around but didn’t find one.
I originally built the clock on Fastly, but they (appear to) have clock offsets of hundreds of milliseconds, so I didn’t release that version. Cloudflare CDN seems synchronized better than what I can measure, although I’m wary of hard to test corner cases, like newly deployed servers.
Why are we assuming that your HTTP-based method running in JS in a browser, using servers that are already distributed and time-synched with tech stacks that you have no insight into, is the “right time” and the directly NTP-synchronized clock of my machine is the “wrong time”?
Hey, author here. You’re asking a couple questions, which I’ll try to unpack.
You’re right to be suspicious that Cloudflare CDN servers have the right time. I tried to call out that concern in the post. Cloudflare operates time services, but their CDN is not a time service and wouldn’t be operated under the same controls. How accurate those servers are is an open question.
When writing the post I observed NTP client logs, a GPS-based clock, and the CDN-based clock report time that agreed within their stated error bounds. I’ve also seen NTP-synchronized and mobile network synchronized system clocks that fell outside the estimates of those other clocks. So it’s an “odd one out” situation.
But I think you are asking the right questions!
No but time.cloudflare.com is. If I recall correctly, the server clocks are synchronised with the same time service. (Source: I work at Cloudflare)
Cool, thanks for taking a look! Do you know of any official reference for how the Cloudflare CDN server clocks are synced? I looked around but didn’t find one.
I originally built the clock on Fastly, but they (appear to) have clock offsets of hundreds of milliseconds, so I didn’t release that version. Cloudflare CDN seems synchronized better than what I can measure, although I’m wary of hard to test corner cases, like newly deployed servers.