Cloudflare Cuts Origin Handshake Latency via Automatic Key Exchange
A new background scanning system reduces HelloRetryRequests from 52% to 3.7%, accelerating 45 billion daily connections.
Cloudflare has deployed Automatic Key Exchange (AKE) to optimize TLS 1.3 handshakes between its edge network and origin servers. The update significantly reduces connection latency by eliminating unnecessary round trips for the vast majority of web traffic.
According to the Cloudflare Blog, the company reduced the rate of HelloRetryRequests (HRR) from 52% to 3.7% for origin connections. Cloudflare, which manages approximately 45 billion daily connections, achieved this by implementing a system that proactively maps the capabilities of origin servers. The infrastructure works by running lightweight TLS handshakes—testing X25519, P-256, P-384, P-521, or X25519MLKEM768—outside the production traffic path to determine which key agreement algorithms an origin supports.
The TLS 1.3 Handshake Challenge
Under the TLS 1.3 protocol, a client must commit to a specific key agreement algorithm in its first packet to establish a secure connection. If the server does not support the chosen algorithm, it must issue a HelloRetryRequest. This forces the client to restart the process with a compatible algorithm, adding a full round trip of latency to the connection setup.
Previously, Cloudflare relied on X25519 as a universal guess for all origins. While efficient for many, this approach was suboptimal for roughly 30% of measured origin connections, leading to the high HRR rates observed before the AKE implementation.
Impact on Web Performance
Reducing handshake latency is critical for improving "time to first byte," a key metric for overall web performance. By shifting the discovery of supported algorithms to a background scanning process, Cloudflare ensures that nearly every production connection completes in a single round trip rather than two.
Beyond immediate speed gains, this infrastructure provides a strategic path for security upgrades. The system allows Cloudflare to roll out post-quantum secure algorithms, such as X25519MLKEM768, without risking latency penalties for origin servers that have not yet adopted these new standards.
Future Outlook
As Cloudflare continues to scale its daily connection volume, the AKE system allows the network to adapt to a diverse and evolving landscape of origin server configurations. The ability to map capabilities in the background means that new cryptographic standards can be introduced based on actual origin support rather than broad assumptions, maintaining a balance between cutting-edge security and optimal performance.