edgeacademyCUSTOMER ENGINEERING
MODULE 02 · LESSON 5 OF 5

Anycast, origin work, and latency evidence

12 min read · Sources linked below

Theory and industry practice are explained below. Cloudflare-specific behavior links to official documentation. Customer examples are hypothetical.

Learning objectives

  • Decompose end-to-end latency
  • Explain the limits of anycast claims
  • Correlate edge and origin observations

The mental model

A fast user experience depends on the whole request path. DNS, connection setup, TLS, network travel, edge processing, origin computation, data transfer, and browser rendering can all contribute. Time to first byte is useful, but it is not the same as total page load time or pure server computation. Anycast lets multiple locations advertise the same service address, with network routing influencing where traffic arrives. It does not guarantee the geographically closest site or eliminate origin distance. A cache hit may avoid origin work; a dynamic request may still cross a long path. Diagnose the slow stage before choosing an optimization.

How it works

Build a timing decomposition and state what each measurement includes. Client-observed time to first byte may include connection work and network latency, depending on the tool and connection reuse. Origin logs usually measure a different interval. Compare equivalent request populations: warm versus cold connections, cache hit versus miss, authenticated versus anonymous, region, response size, and protocol version. Use percentiles to reveal slow tails rather than relying only on averages.

Anycast is a routing arrangement in which multiple sites advertise reachability to the same address prefix. Route selection is influenced by network topology and policy, so physical distance is only one possible factor. A reverse proxy can receive a request at an edge location and then contact an origin elsewhere. During troubleshooting, correlate a request identifier and timestamp through edge and origin records. If edge time rises while origin processing remains stable, investigate the intervening network and connection behavior; if origin processing rises with database wait, focus there. Avoid subtracting unrelated averages and declaring the remainder network latency. Controlled traces and aligned timing definitions support a much stronger explanation than a single global speed-test result.

Applied example · hypothetical

Hypothetical example: a customer sees a 900 ms median API response overseas and assumes DNS is responsible. Measurements show a small DNS interval, a reused connection, and most time before the origin sends a response. Origin tracing reveals a cross-region database call inside a loop. Caching static assets will not fix that operation. A bounded test batches the database work and compares equivalent requests. Separately, the team measures whether routing changes reduce network time. Each improvement is attributed to the stage it actually changes.

In a customer engagement

With Cloudflare, explain edge-to-user and edge-to-origin distances separately. Ask for request-level observations and the customer's definition of latency. Use available analytics together with origin instrumentation, acknowledging that each view has a different measurement boundary. Recommend the smallest test that separates network delay, cache behavior, and application processing before proposing a larger architecture change.

Interview relevance

A common interview prompt asks what happens after entering a URL. A senior answer ends with measurement, not simply rendering. Walk the path, mention reused connections and caches, and show where failures or latency can occur. State which evidence would distinguish a slow origin from a slow network.

Common mistakes

  • Equating TTFB with database execution time
  • Assuming anycast means geographic nearest
  • Comparing unrelated averages as if they were one trace

Key terminology

Anycast — Advertising the same network prefix from multiple locations so routing selects a reachable instance.

TTFB — Time to first response byte as observed and defined by a particular measurement tool.

Tail latency — The slow end of a latency distribution, often expressed using high percentiles.

Explain it without the page

  • Which timing intervals does your favorite diagnostic tool include?
  • How would a warm cache change the path you need to investigate?

Further reading

Sources explain the underlying concepts; examples and practice answers are original course material. Recheck current limits and plan eligibility before a real proposal.