Latency is the time it takes for data to travel from one place on a network to another, usually measured in milliseconds. Proxies add latency because traffic makes an extra hop through the proxy server before reaching its destination, and the distance data travels to and from that proxy server affects how much delay is added.

Distance is one of the principal causes of network latency, and each extra network a request passes through adds more chances for delay.

Round Trips and Time to First Byte

  • Round-trip delay: Network latency is generally measured as a round trip, from the moment a request is sent until the response arrives back.
  • Time to first byte (TTFB): The time between requesting a page and receiving the first byte from the server. It includes the DNS lookup, the TCP handshake and, over HTTPS, the TLS handshake.
  • First requests are slower: A first request includes the DNS lookup, TCP handshake and TLS negotiation. Later requests over the same connection have less latency because the connection is already set up.