Web / NGINX Interview questions
How does NGINX handle SSL session caching for performance?
A full TLS handshake is computationally expensive - it involves asymmetric cryptography and multiple round trips before a connection can carry data. SSL session caching avoids repeating that work for clients who reconnect shortly after their first request.
ssl_session_cache shared:SSL:10m; ssl_session_timeout 10m; ssl_session_tickets on;
ssl_session_cache stores negotiated session parameters in a memory zone shared across all worker processes, so a returning client can resume a previous session with an abbreviated handshake instead of a full one. ssl_session_tickets offers a stateless alternative - the session state is encrypted and handed to the client to present on reconnect, avoiding server-side storage entirely.
Together, these cut both CPU load from repeated handshakes and the latency clients experience reconnecting, which matters a lot on sites with many short-lived HTTPS connections, like ones loading dozens of small assets per page.
More Related questions...