Skip to content
YTEC

Insights

Optimizing content delivery with a Content Delivery Network

World map with an origin server in Europe and CDN servers on every continent; a user in Africa is served by a nearby server.

There are several ways to give your website visitors a pleasant and fast user experience. We recently optimized the BJJ Fightgear webshop for mobile users. But you can do more besides optimizing your code. To deliver static objects quickly, such as images and videos (among other things), Content Delivery Networks (CDN) were invented. Depending on the size of your website and the number of visitors globally, you can decide to deploy such a network.

What does such a network look like?

A CDN is a large number of servers placed at strategic locations across the globe. These servers can save (cache) images, documents and other static content for a certain period (long or short). When a visitor attempts to connect to your website, the network will pick the server best suited to serve the requested data. The network sees which server is placed the closest to the visitors location but also which server is the most cost-efficient, or which server has the least load at the moment of the request.

In most cases this works through DNS. Your static files get their own address, for example static.yourshop.com, which points to the CDN. When a browser looks up that address, the CDN answers with the IP address of a server near the visitor. Your own server, the origin, only gets a request when the CDN doesn't have a file yet or when its copy has expired.

Considerations

Using a CDN can be most advantageous for companies with many users across the globe. If someone in Africa attempts to reach your server in the Netherlands, it will cost more bandwidth, time and money. But a CDN server close to Africa can give the user the requested files more quickly, at lower cost, leading to more conversions and more customer satisfaction.

Watch out when you replace a file. If you upload a new image with the same file name, visitors may get the old one until the copy on the CDN expires. The easiest fix is to give a file a new name whenever its content changes, for example with a version number or a hash. Then the CDN can keep files for a long time.

A CDN is often set up with an external party. There are several providers of CDNs, each with different advantages and disadvantages. Of course, cost is a factor, so it is important to consider whether the benefits outweigh the costs. Take care to research the speed, reliability, locations, costs and security, among other things. YTEC is experienced at this and can help you set up your CDN.

Source: How content delivery networks (CDNs) work, Nicholas C. Zakas