Independent, non-commercial site. Not affiliated with, sponsored by, or endorsed by GoDaddy Inc. GODADDY is a trademark of its owner.

CDN Basics: How a CDN Changes Your Test Results

A content delivery network can make a slow host look fast, and a fast host look identical to a slow one. If you test sites that sit behind a CDN, you need to know which server actually answered.

What a CDN actually does

A CDN is a network of servers, often called edge servers or points of presence, placed in many cities. When a visitor requests a file, the nearest edge server answers if it already holds a fresh copy. If it does not, it fetches the file from your hosting server, called the origin, passes it on and may keep a copy for the next visitor.

Two consequences matter for testing. First, a cached response never touches your host, so it measures the CDN, not the hosting plan. Second, the first request after a cache expires does touch the origin, and that slower request is the one some real visitors get.

Reading the headers: hit, miss, age

You can see which case you are in by looking at response headers. Run a request with headers shown, for example curl -sI https://example.com/, and look for:

  • Age — defined in the HTTP caching standard; it gives the number of seconds the response has sat in a cache. A non-zero value means a cache answered.
  • Cache-Control — set by your site or host; it tells caches how long they may keep the response and whether they may store it at all.
  • Vendor headers — many CDNs add their own header, such as X-Cache or Cloudflare's CF-Cache-Status, with values like HIT, MISS or BYPASS. Names vary, so check your provider's documentation.

HTML pages are often not cached by default, while images, stylesheets and scripts are. That is why a page can show a fast image load and still have a slow first byte.

Testing the origin fairly

When the question is "how good is this hosting plan", you want the origin's numbers. A few ways to get them:

  1. Request an uncached URL, such as a page with a unique query string, and confirm in the headers that the CDN reported a miss or bypass.
  2. If the host gives you a direct origin address or a temporary URL, test that alongside the public address.
  3. Record both results separately. "Edge, cache hit" and "origin, cache miss" belong in different columns of your notes.

Do not mix them into one average. An average of fast hits and slow misses hides both. Report the median and a high percentile for each case.

When a CDN is worth adding

A CDN helps most when visitors are far from the origin, when pages carry many static files, or when traffic arrives in bursts. It helps least with uncached dynamic pages, which still depend on the origin. If you are weighing a CDN as part of a hosting decision, keep that decision separate from where your domain is registered; the registrar basics page covers that other choice. Terms like edge, origin and TTL are defined in the glossary.

Sources and further reading

  • IETF RFC 9111 — HTTP Caching (defines Age and Cache-Control).
  • MDN Web Docs — HTTP caching guide.
  • Your CDN provider's documentation on cache status headers.

Get notified about new notes

An occasional email when a new note is published. No offers, no advertising, unsubscribe any time.