CDN Explains: Performance, Delivery, and Typical Setup Errors
How a CDN works, when it makes sense and which pitfalls are common in caching, assets and technical delivery.
The topic often only becomes relevant when technical details suddenly deteriorate rendering, delivery or display quality. Clean standards save a lot of effort here in the long term.
How a CDN works, when it makes sense and which pitfalls are common in caching, assets and technical delivery. This wiki page arranges the topic practically and shows, When priority arises, which mistakes are often and how you derive concrete measures from them.
Example: After deployment, the old CSS file still appears
The origin server already delivers the new file, a CDN response still contains the old content. Compare the specific asset URL, cache control, age and, if applicable, vendor-specific cache headers. Also check if the HTML page points to the new file version at all.
Fix the appropriate cache level and use versioned asset URLs. A blanket shutdown of the CDN does not solve the cause permanently. Personalized pages and shopping carts require different cache rules than publicly identical images and style sheets.
CDN: Working principle
The network provides scalable delivery and storage capacities. It ensures optimal data throughput even at large peak loads. Its nodes are distributed in various locations and cooperate to serve requests for content economically. The individual locations are called Points of Presence, they are clusters of connected servers. The data is stored in caches (intermediate memories) and can be delivered very quickly or very cost-effectively with low bandwidth as required. Both can work at the same time.
There are very large CDNs with several thousand nodes and several tens of thousands of servers. The content providers first place the content on an original server. From there, it distributes the Content Delivery Network to Replica servers via a distribution system. These keep copies of the content that can be retrieved via a fast request routing system. An accounting system provides the necessary key figures for the request. When a client needs content, it sends a request, whereupon the request routing system selects a replica server.
The selection is made according to its current load, the geographical distance, the latency, the transfer rate and sometimes also via the client identity, which is distinguished, for example, according to standard and premium users. The user request is usually forwarded via DNS-based request routing or via the HTTP status code 302. Well-known CDN providers are, for example, Microsoft Azure, Amazon Web Services, Host Europe and Swiss TXT, there are many more.
Why do you need a Content Delivery Network?
There is content that consumes a lot of data and that nobody wants to store on their own servers. A good example is the image databases. If a webmaster uses images from the network for his website (freely accessible or purchased), he does not want to place them on his own server for capacity reasons. They therefore come from providers who provide such image databases and are retrieved via the CDN.
The webmaster then integrates it as an external source on his own website. This saves resources. The providers of the image database (or other data) do not want to provide their data only from a single server. This should be a) have a huge capacity to process all worldwide requests, b) this would be insecure if this server fails once. Examples of such data are:
- Pictures
- Stylesheets
- Videos and Audios
- JavaScript files
- Web fonts
The network processes all common file formats. This is important so that really all kinds of data can be accessed in this way.
A CDN only unfolds its usefulness clearly when the Website Speed Actually Measure leaves. For the practical examination, an external Website Speed Test, to make before-and-after effects and possible bottlenecks of important URLs visible.