The application logs show a 40 ms backend response time. The browser shows 1.2 seconds to first byte from another continent. The gap is almost always in the TLS handshake — DNS, TCP, and the TLS exchange together — not in the application. Cloud VMs have specific failure modes here worth knowing before blaming the network.
What’s happening
A modern HTTPS request from a fresh client to your origin does this:
- DNS lookup (1 RTT if uncached).
- TCP handshake (1 RTT).
- TLS handshake — 2 RTTs for TLS 1.2 full handshake, 1 RTT for TLS 1.3, 0 RTT with session resumption.
- The actual request and response.
When the TLS handshake dominates page load from distant regions, the usual culprits are: the server negotiates TLS 1.2 instead of 1.3, OCSP stapling is broken so the client makes its own OCSP call, the certificate chain is too long, or session resumption fails because the load balancer is not sharing tickets across nodes.
How to verify
Measure each phase from a representative client location:
curl -w "dns=%{time_namelookup} connect=%{time_connect} \
ssl=%{time_appconnect} ttfb=%{time_starttransfer} \
total=%{time_total}\n" -o /dev/null -s https://example.com/
The ssl - connect gap is the TLS handshake. On TLS 1.3 to a nearby region, expect ~30 ms. From overseas, 200–400 ms for the first connection and far less for resumed sessions.
Inspect what the server is negotiating:
openssl s_client -connect example.com:443 -servername example.com \
-tls1_3 < /dev/null 2>&1 | grep -E 'Protocol|Cipher|OCSP|Verification'
OCSP stapling status:
openssl s_client -connect example.com:443 -servername example.com \
-status < /dev/null 2>&1 | grep -A2 'OCSP Response'
OCSP response: no response sent is the diagnostic for unstapled OCSP — the client has to fetch the OCSP response itself, adding DNS, TCP, and HTTP round trips.
For a remote view:
mtr -n -T -P 443 -c 30 example.com
This shows packet loss and per-hop latency on the TCP path, which often explains a TLS handshake that should be fast but is not.
The fix
- Enable TLS 1.3 on the listener. In nginx:
ssl_protocols TLSv1.2 TLSv1.3;. Most clients prefer 1.3 if offered. - Enable OCSP stapling and verify it returns a response (
ssl_stapling on; ssl_stapling_verify on;plus a validssl_trusted_certificatechain). - Trim the certificate chain. Serve only the leaf and the intermediate(s) actually required. Extra roots add bytes and a parsing cost on every handshake.
- For load-balanced setups, share TLS session tickets across nodes (or use stateful session caching with shared storage). Without this, every connection that fails over to a different node pays the full handshake again.
After these changes, time_appconnect - time_connect should drop to ~1 RTT from any region. The site stops feeling slow from far away even though nothing about the backend changed.
If a client perf audit is producing the same finding repeatedly, Monitoring & Support covers edge and TLS posture as part of standard observability — book a review.