DNS and CDN Routing Guide: Diagnose Slow First-Byte Times by Region
DNS performanceCDN routingTTFBlatency testingglobal delivery

DNS and CDN Routing Guide: Diagnose Slow First-Byte Times by Region

CCached Cloud Editorial Team
2026-11-15
7 min read

Diagnose regional TTFB by separating DNS latency, CDN routing, cache behavior, network paths, and origin response time.

When a website feels slow in one country but performs normally elsewhere, the cause may be DNS resolution, CDN routing, network distance, cache behavior, or the origin server itself. This guide provides a repeatable way to separate those causes, compare regional results, and choose the next diagnostic step without guessing.

Overview

Time to first byte (TTFB) is the elapsed time before a browser or testing client receives the first response byte. It is useful, but TTFB is not a single server measurement. It can include DNS lookup, connection establishment, TLS negotiation, time spent reaching the selected CDN edge, cache processing, and—on a cache miss—the origin server's response time.

This distinction matters when investigating a slow website by country. A high result in one region does not automatically mean the origin is overloaded. The affected users may be resolving the hostname to an unexpected address, reaching a distant edge, bypassing the CDN, or triggering requests that cannot be cached. Conversely, a CDN can appear healthy while its origin is slow on cache misses.

Begin by recording a baseline for the same URL from several locations. Use a cacheable static asset and a representative HTML page where possible. Record the test region, URL, protocol, HTTP status, DNS time, connection time, TLS time, TTFB, total time, response headers, and whether the request was a cache hit or miss. Comparing identical requests is more useful than comparing vague “site speed” scores.

How to compare options

Compare DNS, CDN, and origin behavior as separate layers. A practical investigation follows this order:

  1. Confirm the symptom. Test the same hostname and path from at least two regions, repeating each test enough to identify a pattern rather than reacting to one outlier.
  2. Measure DNS independently. Query multiple public resolvers and authoritative nameservers. A resolver response shows what address a user may receive, but it does not prove that the selected CDN edge is performing well.
  3. Check the route. Use traceroute-style tools or regional probes to identify unusual geographic paths, packet loss, or a connection that is being sent farther from the user than expected.
  4. Inspect CDN headers. Look for the provider's cache-status, age, request identifier, or upstream timing headers. Header names vary, so use the CDN's documentation and your own response configuration as the source of truth.
  5. Measure the origin directly. Request the origin through a protected test hostname, internal endpoint, or controlled monitoring path. Do not expose an origin address unnecessarily just to test it.
  6. Compare cache hits and misses. A warm request and a forced or naturally cold request answer different questions. A fast hit with a slow miss points toward origin processing, cache rules, or cache-fill routing.

A DNS speed test should therefore be treated as one input, not a final verdict. DNS latency can be low while the CDN route is poor, and DNS can be slightly slower while the selected edge and origin path are efficient. Measure the complete request path before changing nameservers or traffic policies.

For a repeatable cache investigation, pair this workflow with the website cache audit checklist. It helps connect regional TTFB results with cache-hit ratio, cache-control headers, and origin request behavior.

Feature-by-feature breakdown

DNS resolution and traffic steering

Review A and AAAA records, CNAME chains, TTLs, health checks, and any geographic, latency-based, weighted, or failover policy. Confirm that the records returned in the affected region are intentional. A stale recursive response, an incorrect record, or an IPv6 path that behaves differently from IPv4 can create a regional symptom.

Useful commands include:

dig example.com A
 dig example.com AAAA
 dig example.com CNAME
 dig @1.1.1.1 example.com A
 dig @8.8.8.8 example.com A

Run equivalent queries from regional systems when possible. Resolver comparisons are most valuable when they reveal different answers or unusually long resolution times. Do not lower TTLs indefinitely as a substitute for understanding the routing design; shorter TTLs can make changes easier to roll out, but the practical result depends on resolver behavior and provider configuration.

CDN edge selection and cache status

A CDN for websites normally attempts to serve a request from an appropriate edge location, but the exact selection depends on the provider's network and configuration. Check whether the regional request reaches the expected edge and whether the response is a hit, miss, bypass, or revalidation. A response that includes Age or a provider-specific cache header can help, but absence of a header does not by itself prove that caching is disabled.

Use a header-only request for a quick comparison:

curl -sS -D - -o /dev/null https://example.com/path

Repeat it from different probes and compare status, cache headers, server timing, content encoding, and redirect behavior. If a request is redirected between hostnames, test the final URL separately. Redirects can make an apparently slow first byte reflect multiple requests.

Origin timing and cache misses

If all regions experience slow misses, investigate application work, database queries, backend connection limits, and origin network distance. If only one region has slow misses, compare which edge is filling the cache and where that edge connects to the origin. An origin-pull path can be efficient for one part of the network and inefficient for another.

Dynamic pages, authenticated requests, personalized content, and APIs often require different cache rules. Do not cache private or user-specific responses merely to reduce TTFB. Instead, define safe cache keys, explicit Cache-Control behavior, and short lifetimes where appropriate. For WordPress or WooCommerce sites, review cookie, session, cart, checkout, and administrator exclusions before making HTML cacheable. The Cloudflare caching rules guide offers a useful example of separating assets, HTML, APIs, and WordPress paths.

Network-path testing

Traceroute and related tools can reveal distance and routing changes, but they are not definitive application measurements. Some routers deprioritize or block diagnostic packets. Use them alongside HTTPS timing rather than treating every timeout as an outage.

traceroute example.com
traceroute -4 example.com
traceroute -6 example.com

Where supported, use an HTTPS probe that reports DNS, connect, TLS, and first-byte timings. The key comparison is whether delay appears before connection, during connection, or while waiting for the response. That location narrows the likely cause.

Reference table: symptom to likely cause

Observed symptomLikely area to investigateNext check
DNS time is high in one region, while connection and origin timing are normalResolver path, authoritative DNS availability, or record configurationCompare multiple resolvers and authoritative responses from that region
DNS is fast, but connect or TLS time is highCDN edge selection, IPv6 path, peering, or network distanceCompare IPv4 and IPv6 and run regional route tests
Cache hits are fast, but misses are slow everywhereOrigin processing or cache-fill overheadMeasure origin TTFB and inspect backend timing
Only one country has slow cache missesRegional edge-to-origin route or traffic policyCompare edge identity and origin timing by probe location
HTML is slow, but versioned assets are fastDynamic rendering, bypass rules, or uncached HTMLInspect cookies, cache-control headers, and application timing
Results vary sharply between repeated testsCold cache, load balancing, congestion, or an unstable originRun a controlled series and correlate request IDs with logs

Best fit by scenario

If you are changing nameservers: capture current DNS answers, TTLs, CDN headers, and regional TTFB first. Validate the new records from several resolvers before switching traffic. Keep a rollback plan and avoid making a DNS change and CDN configuration change at the same time unless the dependency is understood.

If you have a global marketing site: prioritize cacheable HTML, static asset delivery, consistent edge selection, and regional synthetic checks. Confirm that redirects, canonical hostnames, and both IPv4 and IPv6 behave consistently.

If you run WordPress: separate public page caching from logged-in, cart, checkout, preview, and administrator traffic. A WordPress speed audit workflow can help determine whether the problem is hosting or application work rather than CDN routing.

If you operate APIs or personalized applications: measure uncached TTFB, connection reuse, regional origin placement, and safe response caching separately. An edge cache cannot fix an expensive request that must always reach the application.

If availability is the main concern: test failover independently from performance. A fallback route may keep a site reachable while adding latency or changing cache behavior. Use the CDN failover testing runbook to rehearse the change before an incident.

When to revisit

Review this analysis after a nameserver migration, CDN provider change, origin move, traffic-policy adjustment, IPv6 rollout, major caching-rule change, or recurring regional complaint. It is also worth scheduling a lightweight regional check at a regular interval so that routing drift does not remain hidden until a customer reports it.

Keep a small performance record with test URLs, probe locations, DNS answers, cache status, TTFB, total time, and the configuration version tested. Re-run the same requests after each infrastructure change. If results improve, document which layer changed; if they do not, restore the previous configuration before trying another variable.

As a practical next step, select one slow region and one control region. Run DNS queries, HTTPS timing tests, header inspections, and an origin comparison for both. Classify the delay as DNS, connection, CDN processing, cache fill, or origin work. That classification gives you a defensible action—correct a record, investigate routing, revise cache rules, or optimize the origin—instead of another broad website speed optimization experiment.

Related Topics

#DNS performance#CDN routing#TTFB#latency testing#global delivery
C

Cached Cloud Editorial Team

Technical SEO Editors

Senior editor and content strategist. Writing about technology, design, and the future of digital media. Follow along for deep dives into the industry's moving parts.