Networking & Latency
Why "Fast" Code Can Still Feel Slow
Your code might execute in microseconds, but if it takes 3 seconds to reach the user over a 4G connection, the user experience is ruined.
TCP vs UDP
TCP (Transmission Control Protocol) guarantees delivery with a 3-way handshake (SYN → SYN-ACK → ACK). UDP (User Datagram Protocol) is faster but doesn't guarantee delivery — used for video streaming and gaming.
SSL/TLS Handshakes
HTTPS adds another round-trip for the TLS handshake. TLS 1.3 reduces this to a single round trip, and supports 0-RTT resumption for returning visitors.
TTFB (Time to First Byte)
The time between the browser sending a request and receiving the first byte of the response. A good TTFB is under 200ms. Factors: server processing time, network latency, and CDN proximity.
CDNs (Content Delivery Networks)
CDNs cache your static assets on servers worldwide. A user in Mumbai gets your files from a nearby edge server instead of your origin server in Virginia.