Why does a new HTTPS connection take time before the first request?
Sketch your own answer first, then compare it with the one below.
A strong answer
TCP needs one round trip to set up the connection. TLS needs more round trips to authenticate the server and agree on keys. With TLS 1.3 it is one, so a new connection needs two round trips before the request can be sent.
At a 50 ms round trip that is 100 ms of setup. This is why clients reuse connections, and why QUIC, which combines the transport and encryption handshakes, needs one round trip.
Sources
- Eric Rescorla (2018). RFC 8446: The Transport Layer Security (TLS) Protocol Version 1.3.
- Jana Iyengar, Martin Thomson (2021). RFC 9000: QUIC, A UDP-Based Multiplexed and Secure Transport.