Skip to main content
Glossary

Latency

The time delay between a request being sent and a response being received, typically measured in milliseconds.

Detailed Explanation

Latency is one of the most important performance metrics. It directly impacts user experience—studies show that a 100ms delay in page load can reduce conversions by 7%. Latency comes from multiple sources: network propagation (speed of light limits), server processing time, database queries, and client rendering.

Types of latency include: Round Trip Time (RTT, time for a packet to go to the server and back), Time to First Byte (TTFB, how long until the server starts sending data), and application latency (server processing time). Reducing latency requires optimizing at every layer: CDN for static content, database indexing, caching, connection keep-alive, and efficient code.

Why It Matters

Latency directly impacts user experience, conversion rates, and satisfaction. Every millisecond matters, especially for interactive applications.

Real-World Example

Amazon found that every 100ms of additional latency cost them 1% in sales. Google found that a 0.5-second delay in search results reduced traffic by 20%. Latency is not just a technical metric—it is a business metric.

When to Use

Measure and optimize latency for every user-facing application. Focus on the critical path (page load, API responses) and the highest-traffic pages.

Advantages

  • Measurable impact on business metrics
  • Optimization techniques are well-understood
  • CDN and caching provide quick wins
  • Monitoring tools are readily available
  • Competitive advantage in user experience

Disadvantages

  • Physical limits (speed of light) cannot be overcome
  • Optimization requires understanding the full stack
  • Trade-offs between latency and throughput
  • Mobile networks add inherent latency
  • Third-party services introduce uncontrollable latency

Frequently Asked Questions

What is a good latency target?

API responses: under 200ms. Page load (TTFB): under 500ms. Interactive elements: under 100ms. These are targets—actual requirements depend on your application and users.

How do I measure latency?

Use browser DevTools (Network tab), application monitoring (New Relic, Datadog), synthetic monitoring (Pingdom), and real user monitoring (RUM). Measure from multiple locations and network conditions.

What causes high latency?

Common causes: slow database queries, lack of caching, large payloads, network congestion, server overload, SSL handshake overhead, and third-party API calls. Profile your application to identify the specific bottleneck.

How does latency differ from bandwidth?

Latency is the delay (how long it takes). Bandwidth is the capacity (how much data can flow). High bandwidth with high latency means large transfers are fast but the first byte takes long. Low latency with low bandwidth means fast response but slow large transfers.

What is edge computing and how does it reduce latency?

Edge computing runs your code at CDN locations worldwide, close to users. Instead of all requests traveling to a central server, they are processed near the user. Cloudflare Workers and Vercel Edge Functions execute code in under 1ms at the edge.

Back to Glossary

Browse all terms in our software development glossary.

Browse All Terms