In plain English The delay before data starts arriving. Mostly caused by distance: a server on the other side of the world takes longer to answer.
Latency is the delay between asking for something and the first of the answer arriving, usually measured in milliseconds. For websites, it is mostly the time data takes to travel between the visitor and the server and back, called the round-trip time. It differs from bandwidthBandwidth How much data your website is allowed to send to visitors each month. Every page view uses a little; images and video use the most. More about Bandwidth →, which is how much data can flow once it starts.
Why distance matters
Signals in fibre travel at about two thirds of the speed of light, and real routes are longer than a straight line. Rough round-trip times:
| Between | Typical round trip |
|---|---|
| Same city | Under 5 ms |
| London and Frankfurt | About 15 ms |
| New York and London | About 70 ms |
| London and Sydney | About 250 ms |
A page load is not one round trip. Looking up DNSDNS The internet’s phone book. It turns a name people can remember, like example.com, into the number address computers use to find the server. More about DNS →, opening the connection, setting up HTTPS and fetching the page each take at least one, and the page then requests its images and scripts. On a distant server, the delay adds up to seconds.
Measure it
ping -c 4 example.com
curl -o /dev/null -s -w "connect %{time_connect}s, first byte %{time_starttransfer}s\n" https://example.com/
ping shows the round trip. curl separates connection time from the time the server took to answer.
Reducing it
Host near your visitors, use a CDN so files are served from nearby, and use HTTP/2 or HTTP/3 and TLS 1.3, which need fewer round trips. Server caching reduces the time the server itself adds.