Short answer: Latency is the time data takes to travel between a visitor and your server, usually measured as a round trip in milliseconds. It is set mostly by distance and the route, not by how fast the connection is. Every new connection to a website costs several round trips before the first byte arrives, so a server near your visitors, a CDN for static files and good caching make pages feel much faster.
Two connections can have the same speed in megabits and still feel completely different when you open a website. The difference is usually latency.
Latency vs bandwidth
- Bandwidth is how much data can flow at once: the width of the pipe.
- Latency is how long each piece takes to arrive: the length of the pipe.
A big file download depends mostly on bandwidth. Loading a web page depends heavily on latency, because a page is made of many small requests and several back-and-forth steps before anything is shown.
Why distance sets a floor
Data in fibre travels at about two-thirds of the speed of light, roughly 200,000 km per second. That works out to about 1 millisecond of round trip for every 100 km of fibre, before any router, queue or server adds its own time. Cables rarely follow a straight line either, so real routes are longer than the map distance.
That is why a server on another continent can never feel as quick as one nearby, however powerful it is. Choosing where your server lives is one of the most important speed decisions you make. See how to choose a server location.
How latency adds up on a page load
Before a visitor's browser receives the first byte of your page, it usually needs:
- A DNS lookup to find your server's address (fast if cached).
- A TCP connection: one round trip.
- A TLS handshake for HTTPS: one more round trip with TLS 1.3.
- The request itself: one more round trip, plus the time your server takes to answer.
At 150 ms per round trip, that is easily half a second before anything appears. At 20 ms it is a fraction of that. The time to the first byte is called TTFB; our guide to TTFB explains how to read it, and the website speed test measures it for any site.
Ways to reduce latency
- Host close to your visitors. If most of your customers are in West Africa, a server in or near the region beats one in another continent. See website speed in Africa.
- Use a CDN for images, CSS and scripts. A CDN keeps copies on servers around the world, so those files travel a short distance. See what a CDN is.
- Cache pages. A cached page skips the server's processing time, which is the part you control most directly. See caching explained.
- Turn on HTTP/2 and HTTP/3. HTTP/2 sends many files over one connection; HTTP/3 combines the connection and encryption handshakes, saving a round trip. See HTTP/3 explained.
- Use fewer third-party domains. Every extra domain (fonts, trackers, widgets) can mean another DNS lookup and connection.
- Keep connections open. Keep-alive lets the browser reuse a connection instead of opening new ones.
How to measure latency
- ping shows the round trip to a server; traceroute shows where along the route time is added. See how to use ping and traceroute.
- Browser developer tools (Network tab) break each request into DNS, connection, TLS and waiting time.
- TTFB from our website speed test shows connection and server time together.
Frequently asked questions
What is a good latency for a website?
Round trips under about 50 ms feel instant for most visitors. Up to around 100 ms is fine; above 150 ms the delay becomes noticeable on each new connection.
Does more bandwidth reduce latency?
Not much. More bandwidth helps big downloads, but the time for each round trip is set by distance, the route and congestion.
Does a CDN replace a nearby server?
For static files, a CDN does most of the work. Pages built by your server on each visit (shops, logged-in pages) still travel to your origin server, so its location still matters.
Is latency the same as ping?
Ping is a way to measure latency: it reports the round-trip time to a server.



