Speed and performance

CDN — delivering cached content closer to visitors

A content delivery network distributes delivery across multiple locations and can cache suitable responses nearer to visitors. It can reduce latency, offload the origin and add operational features, depending on the service and configuration.

Published: Updated: 3 min read
Diagram: CDN - content delivery network. Source - Edge - Receiver.

What is CDN?

A content delivery network distributes delivery across multiple locations and can cache suitable responses nearer to visitors. It can reduce latency, offload the origin and add operational features, depending on the service and configuration. It does not automatically make a slow application efficient, and it must not cache private customer information as though it were a public asset.

What can be cached?

Common candidates are versioned CSS, JavaScript, and public images. HTML can also use the cache if its mutability rules are known. Accounts and personalized shopping carts require proper protection. Cookies, parameters, language and authentication affect the key and the ability to reuse the response by another visitor.

Linguistic example

The home page selects the language based on the user's settings, and /de/ and /nl/ present stable translations. Saving the first guest's redirect as a public reply would send subsequent people to the wrong version. A negotiated response requires a secure policy, and explicit language addresses require separate entries. The rule must be derived from behavior, not just file extension.

How to plan implementation?

Divide responses by purpose and establish a policy for each group. Use versioned resource addresses and schedule variable content invalidation. Check HTTPS, source connection and errors. Watch headers and repeated requests to distinguish between cache hits, misses, and bypasses. Maintain the ability to quickly undo an erroneous rule.

Common misconceptions

CDN itself does not remove expensive database queries or browser work. A cache hit does not prove freshness, and a miss does not necessarily mean a failure. Long storage without versioning may leave incompatible scripts after an update. Caching every GET without parsing risks confusing languages, sessions, and user data.

How to measure benefits?

Compare latency, transfer size, source load and errors for relevant regions. Check the forms, cart and login. Observe real loading metrics, not just the infrastructure dashboard. The implementation should increase speed while maintaining the timeliness, privacy and predictability of publications. These conditions are as important as reducing response times.

What to check after enabling CDN?

Compare source and agent response for public page, account, shopping cart and different languages. Determine what headers and cookies affect the cache. Too general a configuration may speed up the test while showing the wrong price or content to someone else. A key that is too specific can, in turn, almost disable caching. The rules must match what really changes the representation of the resource.

After publication, ensure that the new HTML version references compatible styles and scripts. Invalidating one file does not remove all copies of dependent resources. Monitor errors, cache hits, and latencies, but don't equate a high hit rate with correctness. In the event of a source failure, specify whether an older version is allowed to be shown and for what content; not all information can safely remain out of date.

Sources and further reading

Use the primary documentation to check the principles and limitations described in this article.

How we prepare the glossary

These articles combine original editorial work, AI support for editing and translation, and checks against linked primary documentation. Examples are illustrative unless stated otherwise; they do not represent client results. Dates refer to publication and actual content changes.

From knowledge to action

Need help putting this into practice?

Tell us about your website or process. We will define the scope and the next practical step.

Discuss your project