ServerField Server operations and website growth
Server terms and web performance Updated July 29, 2026

What is a CDN?
How it works, its benefits, and deployment steps explained

A CDN is a distributed delivery platform that receives traffic between users and origin servers. It is not simply a system that places files on a nearby server. Speed, stability, and security depend on correctly designing cache keys, TTL, revalidation, and origin protection.

Published: December 5, 2024 Last checked: July 29, 2026 For beginners, website owners, and developers Written and reviewed by Finite Field Editorial Team

A CDN (content delivery network) is an intermediary layer for websites, APIs, video, and file delivery. Cache hits avoid origin traffic; uncached requests can still use TLS termination, a WAF, rate limits, and routing optimization. Incorrect settings can cause stale content, mixed personal information, higher costs, or search crawling failures, so design and verification matter more than deployment alone.

This article contains no advertising or affiliate links. We use IETF RFCs for HTTP caching standards, official AWS CloudFront and Cloudflare documentation for implementation examples, Google Search Central for crawler behavior, and official cache-security guidance. Prices, locations, defaults, and features vary by contract, region, and time; check the provider's latest documentation when implementing.
The answer first

A CDN is a distributed delivery and control layer between users and an origin

Its value is not copying every piece of data to the nearest server.Which requests may share a response, how stale it may be, and who may reach the origin are governed by rules so more traffic can be handled at locations close to users.

HITs can reduce latency and loadThe edge returns a stored fresh response, reducing origin round trips and processing.
MISSes and dynamic operations remainFirst requests, expired entries, personalized pages, and POSTs can reach upstream systems, so origin performance still matters.
Security depends on configurationMistakes in cache keys, TTL, authentication, origin protection, or monitoring can cause incidents more serious than a speed issue.

What is a CDN? Meaning and components

A CDN (content delivery network) receives HTTP requests between users and the origin server and delivers or forwards content through distributed locations. When public DNS points at a CDN, requests are routed to an appropriate location considering latency, network paths, failures, and capacity.

Shared caching is central to a CDN but not its only capability. Depending on product and contract, it may offer TLS termination, HTTP/2 and HTTP/3, compression, image transformation, WAF, DDoS protection, bot management, rate limits, edge code, logs, and signed URLs. It is useful to think of it as a distributed reverse-proxy platform that includes caching, not merely a cache server.

ORIGIN

Origin server

The upstream source that produces authoritative content or application responses, such as a web server, load balancer, object store, or API.

EDGE / POP

Edge / POP

A distributed location receiving user traffic and potentially serving stored responses, TLS, compression, rules, and security processing.

CACHE

Cache

A mechanism that stores previous HTTP responses and reuses them for eligible later requests. A browser cache and a CDN shared cache are distinct.

REVERSE PROXY

Reverse proxy

Receives requests in front of users and forwards them upstream. A CDN edge acts as a reverse proxy, but a single-location proxy is not necessarily a CDN.

The physically closest location is not always selectedA CDN considers latency, route quality, failures, congestion, contracts, and regional restrictions as well as distance. Nearest is a useful shorthand, but the appropriate location at that moment is more accurate.

CDNs, caches, DNS, and load balancers

TermPrimary roleRelationship to a CDN
CDNDelivers and forwards content through distributed locations, controlling routing, caching, and securityA delivery layer between users and origin
CacheReuses stored responses and computed resultsA major CDN feature that also exists in browsers, applications, and databases
DNSResolves domain names to connection destinationsCan direct users to a CDN; DNS does not itself serve web content
Load balancerDistributes requests among backendsUsually distributes origin-side applications, a different layer from CDN edge delivery
Web hostingProvides web servers, storage, and runtimesCan be the CDN origin; maintenance, backups, and capacity remain necessary
WAFDetects and blocks malicious HTTP trafficMay be integrated with a CDN, but still requires rule design and false-positive handling

How a CDN works: from request to cache hit or miss

Follow the request entry, cache-key creation, stored-response freshness check, origin fetch, and response storage. This is a generalized flow; intermediate layers such as regional or tiered caches differ by product.

Reach a CDN edge through DNS and routing

When a user accesses a URL, public-hostname DNS and provider routing direct the request to a POP. For HTTPS, TLS is established between the user and edge.

Build a cache key from the request

A CDN combines host and path with configured query strings, headers, cookies, methods, and other inputs. The same key means requests are treated as eligible for the same response.

HIT when the stored response is fresh

If a stored response for the key meets freshness conditions such as TTL, the edge returns it. Avoiding an origin round trip can reduce latency and upstream load.

MISS when absent; revalidate when expired

If no response is stored, fetch from an upper cache or origin. An expired response can be revalidated using ETag or Last-Modified, and a 304 Not Modified can reuse the stored body.

Store eligible responses and return them to users

Forward the origin status, headers, and body, and store the response for later if cacheability and TTL allow it. Check implementation and configuration for Set-Cookie, Authorization, status codes, and object sizes.

Example: 850 HITs out of 1,000 requests

These figures illustrate the mechanism. Dashboards differ by product in whether only cache-eligible requests form the denominator, how BYPASS and REVALIDATED are counted, and where tiered caches are measured.

CACHE HIT RATIO850 ÷ 1,000 = 85%

An example of the share of eligible requests served from a fresh edge cache. Compare HIT and MISS response times as well as the hit rate.

SIMPLIFIED ORIGIN OFFLOAD1 − (150 ÷ 1,000) = 85%

A simple calculation assuming hits did not reach the origin. Tiered caches, request collapsing, and subrequests can make non-HIT counts differ from origin requests.

A higher hit rate is not always betterSharing personalized APIs merely to increase HITs compromises security. Frequently updated, low-traffic URLs may rarely HIT even when configured correctly. Evaluate origin offload, p50 and p95 latency, correctness, error rates, and cost for each URL group.

Cache keys, TTL, and Cache-Control are central to CDN design

More important than the number of locations are the cache key, which determines which requests may share a response, and TTL, which determines how long it may be reused. Ambiguity can fragment responses and lower the hit rate or mix responses intended for different users.

Include only values that actually change the response in the cache key

  • Base:Host, path, and necessary query strings
  • Consider including:Language, currency, tenant, image format, and other inputs that change the origin response
  • Consider excluding:Unnecessary fragmentation from unique session IDs, tracking queries, or many User-Agent variants
  • Authenticated pages:Do not share while ignoring Authorization or session cookies. Generally bypass shared caching or isolate strictly if sharing is justified
Omitting required cache-key inputs can expose informationIf a response varies by tenant, permission, currency, or language but the key does not, another user's response may be served. Conversely, unnecessary values fragment the cache and waste capacity and hit rate.

Key Cache-Control directives

DirectivePrimary meaningPractical considerations
max-ageSeconds for which the response is considered freshAffects browsers and shared caches; consider s-maxage for a different shared-cache lifetime
s-maxageFreshness lifetime for shared cachesTakes precedence over max-age in a CDN; check provider implementation and override rules
publicExplicitly permits storage in shared cachesBefore sharing authenticated responses, verify strictly that the content is truly identical for everyone
privateDo not store in shared cachesPrivate caches such as browsers may store it; consider no-store for sensitive information
no-cacheRequires revalidation before reuseDoes not prohibit storage. With ETag or Last-Modified, a 304 can reuse the body
no-storeProhibits storageConsider for personal, payment, or sensitive responses; check whether CDN rules override it
must-revalidateDo not reuse a stale response without validationUseful for important information that must not be served stale during origin failure, with an availability tradeoff
stale-while-revalidateServe a stale response for a limited time during revalidationCan reduce waiting, but evaluate product differences and staleness of critical information
stale-if-errorAllow a stale response for a limited time on origin errorCan maintain access during failure; configure carefully for prices, stock, and legal information
immutableIndicates that content will not change while freshCombine with versioned URLs such as content-hashed CSS, JavaScript, and images

Check RFC semantics separately from CDN product defaults. CDN cache rules, minimum TTL, or status-code TTL can override origin headers.

Example headers by use case

# Static file with content hash
Cache-Control: public, max-age=31536000, immutable

# Public HTML: five minutes in browsers, one hour in the shared CDN
Cache-Control: public, max-age=300, s-maxage=3600
ETag: "page-v42"

# Authenticated page containing personal information
Cache-Control: private, no-store

These examples are starting points. Test update requirements, provider rules, browser caching, revalidation, and permitted staleness.

Also understand CDN-Cache-Control and Cache-Status

RFC 9213 defines the concept of directives for particular shared caches such as CDNs, separately from general Cache-Control, and the CDN-Cache-Control header. It is useful when browser and CDN TTLs differ, but check provider support and precedence over proprietary headers.

RFC 9211's Cache-Status header reports how a cache handled a request in a standardized format. Not every CDN always emits it, so also use provider-specific headers such as Age、Via、CF-Cache-Status、X-Cache and logs.

Five CDN benefits

Benefits involve more than nearby servers: skipping origin work on hits, optimizing connections and compression at the edge, and distributing spikes combine to create an effect.

01 SPEED

Can speed display and downloads

Serving from an edge near users and avoiding origin round trips can reduce waits for images, CSS, JavaScript, public HTML, and video.

02 OFFLOAD

Can reduce origin CPU, bandwidth, and connections

Reusing the same response at the edge can reduce requests and transfer to web servers, storage, APIs, and databases.

03 SCALE

Can absorb traffic spikes

Distributed locations can handle concentrated requests for the same content after news coverage, campaigns, video releases, or software distribution.

04 RESILIENCE

Can serve some public content during failure

A public GET configured to allow stale responses may return stored content while the origin is temporarily unavailable. This is not complete disaster protection.

05 SECURITY

Can control attacks before they reach the origin

Apply WAF, DDoS protection, bot management, rate limits, and TLS termination at the edge and narrow origin exposure.

IMPORTANT

Benefits are concentrated on cacheable hits

Cold caches, personalized APIs, POSTs, writes, authentication, and database processing depend on the origin. Upstream performance, redundancy, and monitoring remain necessary.

CDN drawbacks and deployment considerations

A CDN adds another layer of paths and state. Even if delivery is faster, updates, failures, and security can become harder to diagnose, so do not consider benefits alone.

Stale information can remain

TTL and browser, edge, and regional caches can overlap, leaving old HTML or images after updates. Design versioned URLs, revalidation, and targeted purges.

Personal information can be mixed

A shared cache that ignores session, tenant, Authorization, or Cookie can cause severe data exposure. Generally bypass authenticated pages and test with separate users.

Misses add a hop

The user→CDN→origin path can make uncached traffic slower due to edge processing or connections. Measure dynamic APIs.

Costs can be hard to predict

Billing may include transfer, requests, functions, WAF, logs, purges, and dedicated IPs. Attacks, hotlinks, or cache-busting queries can also increase costs.

More failure and configuration points

CDN outages, DNS, certificates, WAF false positives, configuration propagation, and global purges add failure modes. Plan bypass, rollback, and access control.

Terminology varies by product

Definitions of HIT, MISS, BYPASS, DYNAMIC, EXPIRED, STALE, and UPDATING differ. Check dashboard denominators and log specifications in official documentation.

Simply enabling a CDN does not make acceleration safeAt minimum, document cacheable content, keys, TTL, updates, authentication boundaries, direct origin access, failure behavior, monitoring, and cost limits by URL group.

Content suited to a CDN and traffic that should not use a shared cache

Rather than judging only by extension, classify content by whether users with the same key may receive the same response、how stale it may be、and whether it depends on authentication or personal information.

Content-hashed CSS, JavaScript, and imagesVery suitable Long TTLs enable reuse, and content-specific URLs help avoid update mistakes.Switch HTML to new URLs without immediately deleting old assets. Combine immutable with versioned URLs.
Public HTML and articlesSuitable Pages that return the same content to many users can reduce origin load with short TTLs or revalidation.Check login state, previews, A/B tests, language, cookies, error caching, and update propagation.
Video and large downloadsSuitable Can reduce delivery distance and origin transfer for large objects and distribute concentrated demand.Check range requests, seeking, signed URLs, revocation, transfer costs, hotlinking, and object limits.
Public GET APIsConditional Product lists and similar endpoints returning the same response to the same query can absorb bursts through short-term caching.Reflect query normalization, currency, region, language, pagination, error caching, and acceptable staleness in keys and TTLs.
Authenticated and personalized pagesGenerally avoid shared caching TLS, WAF, rate limits, and dynamic forwarding remain available through the CDN.Do not store personal information in shared caches or create keys that ignore session, Authorization, or tenant identity.
POST, updates, and paymentsNot a shared-cache acceleration target Normally forward to the origin, using the CDN as an entry point for security controls.Check timeouts, body limits, retries, idempotency, WAF false positives, and webhook source restrictions.
Both 'dynamic content cannot use a CDN' and 'a CDN caches everything' are wrongDynamically generated HTML and APIs can be cached when responses are shareable across users; even images cannot be shared unconditionally if they are private and protected.

CDNs and SEO: no direct ranking boost

Simply using a CDN does not increase rankings. Better speed and availability may indirectly help user experience and crawl stability, but content quality, search intent, indexability, canonical URLs, HTTP status, internal links, and rendering must be correct.

Google Search Central describes a CDN as an intermediary between origin and users and does not treat CDN use as inherently problematic. However, a cold cache can send Googlebot's first fetch to the origin, so origin capacity matters during crawl spikes. Correct HTTP caching can make refetching more efficient and reduce delivery load.

SEO checks during CDN deployment or migration

  • Status:Return 200 for normal pages, appropriate 301 or 308 redirects for moves, and 404 or 410 for nonexistent URLs
  • Robots:Do not accidentally change robots.txt, noindex, or X-Robots-Tag through CDN rules or error pages
  • Canonical:Use the public canonical URL rather than a CDN hostname and check Host headers and redirects
  • Crawler blocking:Ensure WAF, bot protection, and rate limits do not mistakenly block Googlebot or major crawlers
  • Error caching:Avoid long caching of temporary 5xx or 403 responses and check that stale errors disappear after recovery
  • Rendering:Ensure CSS, JavaScript, images, and fonts load on mobile without 403, CORS, or expired signature errors
  • Speed:Measure cold caches, HTML, the LCP image, third-party scripts, and origin responses as well as hits
A CDN does not turn low-quality content into high-quality contentFast delivery does not solve thin or duplicate content, a mismatch with search intent, or incorrect indexing settings. Treat a CDN as an infrastructure improvement.

CDN security: consider origin protection and cache boundaries as well as a WAF

A CDN can intercept attacks before they reach the origin, but deployment alone does not make a system secure. Direct access to the origin can bypass a WAF or rate limits.

Use HTTPS from user to edge and edge to origin

Protect the origin side as well as the viewer side with TLS, and check certificate names, SNI, Host headers, redirects, and TLS versions.

Restrict direct origin access

Use supported mechanisms such as OAC, signed requests, mTLS, authenticated custom headers, firewall allowlists, or private networks to close non-CDN paths.

Design signatures and expiration for private content

Check signed URLs and cookies, permission revocation, cache keys, range requests, and resumable downloads together to limit the impact of leaked URLs.

Test cache poisoning and deception

Consider attacks that exploit headers outside the key or differing path interpretation to share harmful responses, or make an authenticated page look like a static file so it is stored.

What CDN DDoS protection can and cannot do

A CDN can improve resilience by absorbing traffic across a large network, blocking known attacks at the edge, and keeping cache hits away from the origin. Layer-7 attacks against expensive authenticated APIs or searches, cache busting, bots resembling legitimate users, and usage-based charges during attacks require separate measures.

Do not assume complete protectionLayer WAF, rate limits, bot management, origin restriction, application input limits, timeouts, queues, circuit breakers, budget alerts, and emergency blocking procedures.

Seven steps to deploy a CDN safely

Do not cache every URL at once. Start with observable static assets, expand gradually, compare URL, body, headers, status, latency, origin requests, and cost before and after, and preserve a bypass or rollback path.

1. Classify URLs and data

Separate static assets, public HTML and APIs, authenticated pages, uploads, administration, and errors; record methods, queries, headers, cookies, personal data, update frequency, maximum size, and range support.

2. Define success measures and tolerances

Set p95 latency, origin requests and bytes, error rate, cost, acceptable staleness, and stale-on-error policy. Do not target hit rate alone.

3. Verify DNS, TLS, and origin connectivity on a test host

Check viewer and origin TLS, Host, SNI, IPv4 and IPv6, CNAME, CAA, redirects, and certificate renewal. Compare the same URLs and headers before production cutover.

4. Define cache policy by URL group

Specify cacheability, keys, TTL, stale and error caching, compression, and forwarded headers, cookies, and queries. Start with hashed assets.

5. Test security boundaries

Check that response bodies do not mix between users, tenants, languages, or currencies, private content does not remain after logout, and direct origin access is restricted.

6. Prepare release, purge, and rollback

Use content-hashed static URLs and switch HTML to new versions. Plan emergency purge targets, completion checks, rate limits, costs, and the resulting miss surge.

7. Release gradually and monitor edge and origin together

Start with selected hosts, paths, or traffic and compare requests, bytes, cache status, latency, 4xx and 5xx, TLS, WAF, origin load, and cost on the same timeline.

A practical rollout orderExpand from content-hashed static assets to public images and downloads, short-lived or revalidated public HTML, shareable GET APIs, and then necessary edge processing to limit the scope of incidents.

Post-deployment checks with curl, headers, and logs

A browser's apparent speed alone cannot distinguish browser caching, CDN caching, and origin processing. Fetch the same URL several times and compare response headers with CDN and origin logs.

Start with response headers

# Inspect headers only
curl -I https://example.com/assets/app.a1b2.css

# Request the same URL several times without cache busting
curl -sS -D - -o /dev/null https://example.com/article/

# Extract selected headers and status
curl -sS -D - -o /dev/null https://example.com/ \
  | grep -Ei '^(HTTP/|age:|cache-control:|etag:|vary:|cache-status:|cf-cache-status:|x-cache:)'

Metrics to inspect

MetricWhat it showsConsiderations
Cache statusHIT, MISS, BYPASS, EXPIRED, STALE, REVALIDATED, and othersNames, denominators, and treatment of cache tiers vary by product
AgeApproximate seconds since storage in a shared cacheMay reset or disappear after revalidation, purge, eviction, or movement between tiers
Origin requestsRequests that actually reached upstreamMay differ from edge non-HIT counts
Origin bytesData transferred from upstream to CDNAccount for large objects, ranges, compression, and cache tiers
p50, p95, and p99 latencyIdentify slow users and misses hidden by averagesBreak down by HIT or MISS, region, path, and status
4xx and 5xxWAF false positives, origin errors, and certificate or DNS problemsCheck whether error responses are cached
CostChanges in transfer, requests, functions, WAF, and logsSeparate bot traffic, hotlinks, attacks, and cache busting

Common problems and investigation order

Content is stale after an update

Check browser cache, edge Age and status, TTL and s-maxage, purge targets, upper caches, then the origin body.

Hit rate does not increase

Check cache eligibility, Set-Cookie, Authorization, query variation, Vary, minimum TTL, object eviction, and traffic volume.

Another user's content appears

Immediately bypass and purge the cache, then investigate keys, Cookie, Authorization, tenant, Vary, and URL normalization. Treat it as a serious incident.

502 or SSL error only through the CDN

Check the origin certificate name, SNI, Host header, TLS version, firewall, origin timeout, DNS resolution, and IPv6.

How to compare CDN services

A large location count or free tier alone is not enough. Compare the following against your regions, content, authentication, and operational capability.

Delivery regions and measured latency

Measure HIT and MISS, HTML and large files, in regions where users are concentrated. Do not choose by advertised location count alone.

Cache-rule expressiveness

Check whether path, status, headers, cookies, queries, TTL, stale behavior, purges, and tiered caches meet requirements.

Origin protection and private delivery

Check OAC equivalents, mTLS, private networks, signed URLs and cookies, key management, and revocation.

WAF, DDoS, and bot protection

Check included coverage, extra charges, rule limits, managed rules, rate limits, logs, and emergency contacts.

Logs, analysis, and export

Check export of cache status, origin latency, request IDs, WAF, region, and cost, along with retention and delay.

Pricing and support

Compare transfer, requests, purges, functions, logs, WAF, dedicated features, minimum contracts, attack-related billing, and support hours under the same traffic assumptions.

Free tiers help evaluation but may not meet production requirementsWAF, logs, cache keys, purges, SLAs, support, origin protection, and data residency may be restricted to paid plans. Consider future traffic and operational responsibilities.

Frequently asked questions about CDNs

Are a CDN and a cache the same?

No. A cache stores and reuses responses; a CDN is a distributed delivery platform between users and the origin. A CDN can also provide TLS, a WAF, routing, and dynamic forwarding.

Will a CDN always make a website faster?

Not always. Hits avoid origin round trips, but cold caches, dynamic processing, overly fragmented keys, or expensive edge processing may yield little improvement. Measure before and after under the same conditions.

Can a CDN serve dynamic content or APIs?

Yes. Briefly cache shareable GET responses or forward through the CDN without caching to apply TLS, a WAF, and rate limits. Generally do not share responses containing authentication or personal data.

Does Cache-Control: no-cache prohibit storage?

No. No-cache requires revalidation before a stored response is reused; no-store prohibits storage. Also check for overrides by CDN rules.

Does a WordPress site need a CDN?

Not necessarily. It may help with overseas visitors, large images, traffic spikes, or origin load. For a small domestic site, image compression, removing unnecessary plugins, and improving servers or databases may be more effective first.

Does a CDN improve search rankings?

There is no direct ranking guarantee. Speed and availability improvements may help user experience or crawl stability, but content quality, indexing, canonical URLs, status, and rendering remain prerequisites.

Does a CDN completely prevent DDoS attacks?

No. A CDN is one defense layer; combine it with a WAF, rate limits, origin restriction, protection against expensive application operations, attack-cost monitoring, and emergency response.

What cache hit percentage is good?

There is no universal target. Static assets may readily achieve high rates, while lower rates can be normal for frequently updated HTML or personalized APIs. Evaluate origin offload, latency, errors, correctness, and cost together.

Why does an old page appear after an update?

A browser or CDN may still consider a stored response fresh. Use content-hashed static URLs, short TTLs or revalidation for HTML, and targeted purges for urgent updates.

Primary and official sources reviewed

We distinguish HTTP standards from product-specific CDN examples. Do not treat product defaults or status names as universal CDN specifications.

Design cache keys, freshness, and origin protection together

A CDN puts distributed edges between users and an origin, reuses cacheable responses, and forwards uncached traffic. Hits avoid origin round trips, while misses, revalidation, dynamic requests, and writes reach upstream.

For safe deployment, define cacheability, keys, TTL, versioning and purges, staleness, and authentication boundaries by content type. Monitor edge and origin requests, bytes, latency, status, and cost on the same timeline. Sustainable acceleration requires preventing shared personal data, stale critical information, origin bypass, and post-purge load spikes.

  • First:Classify URLs and data as public, shareable, or personalized
  • Configuration:Include only response-changing inputs in the cache key and choose TTL and update methods
  • Security:Test direct origin access, authenticated pages, cache poisoning, and deception
  • Operations:Track origin offload, p95 latency, errors, and cost as well as hit rate
Finite Field

Finite Field Editorial Team's update policyWe distinguish standards such as RFCs from provider-specific behavior. Rather than judging only location counts or pricing, we update practical guidance on post-launch updates, security, failure behavior, and cost.

FINITE FIELD WEB PRODUCTION

Build a website with Finite Field, considering CDN and performance

You may be unsure whether servers or images cause slowness, concerned about CDN updates and caching, or considering a site-wide SEO renewal. Finite Field can plan information architecture, implementation, servers and CDNs, and post-launch operations alongside visual design.

Website development SEO and information architecture CDN and cache design Server migration Performance and operations improvements
  • Review the current site, server, DNS, forms, and update process
  • Design for update propagation, security, and cost as well as speed
  • Document test publication, rollback, and post-launch checks
PROJECT CONSULTATION

Discuss development, performance, and migration together

After reviewing your current situation and goals, we explain the necessary scope, approach, and estimated cost. If a CDN is unnecessary, we prioritize improvements to images, implementation, or servers.

The current site URL, problems, update method, and server help us give more concrete guidance.