HTTPS Performance: Session Resumption
You'll learn how TLS session resumption techniques reduce the overhead of repeated HTTPS connections.
The Performance Problem
You've learned that the TLS handshake establishes secure connections through asymmetric cryptography, digital certificates, and cipher suite negotiation. While secure, this process is computationally expensive—especially the asymmetric operations used during key exchange. Every new connection repeats this costly dance.
For a user revisiting a website or making multiple API calls, performing a full handshake each time wastes CPU cycles and adds latency. Session resumption solves this by allowing clients and servers to skip most of the handshake on subsequent connections.
Session IDs: The Original Approach
With session IDs, the server generates a unique identifier during the initial handshake and stores the session's cryptographic parameters (master secret, cipher suite) in memory. The client saves this session ID.
On reconnection, the client sends the session ID in its initial message. If the server still has that session in cache, both sides regenerate the encryption keys from the stored parameters—no expensive asymmetric operations needed. Think of it like a "fast pass" at an amusement park: show your ticket and skip the long line.
Limitation: The server must maintain state for all active sessions, which doesn't scale well for high-traffic sites with load-balanced servers.
Session Tickets: Stateless Resumption
Session tickets flip the storage burden to the client. The server encrypts the session state using a secret key only it knows, then sends this encrypted "ticket" to the client. The client presents the ticket on return visits.
The server decrypts the ticket to recover the session parameters—no database lookup required. This is stateless and scales beautifully across server farms.
Key Takeaway: Session IDs and session tickets enable TLS session resumption by caching or encrypting connection state, dramatically reducing handshake overhead for repeat connections.