A deep dive into why time.gov displayed inaccurate clock offsets. The root cause was the HTTP `Connection: close` header, which forced browsers to create a new TCP+TLS connection for every request. The JavaScript timing code assumed a single network round-trip (like NTP), but actually measured three, introducing a full round-trip worth of error. NIST fixed the issue around April 24th by switching to `keep-alive`. The author also proposes using the `PerformanceResourceTiming` API for more precise measurement of just the HTTP layer, and provides a client-side patch demonstrating the improvement.

9m read timeFrom alexsci.com
Post cover image
Table of contents
NTP and half round-trip timeDistributing time over HTTPWhat happened on the network?How can this be fixed?NIST adds a keep-alive headerRemaining precision concernsFurther improvementsClosing thoughts
1 Comment

Sort: