September 26, 2019
Revelation of the leading specialist of the INXY.COM company - the hosting services marketplace.
CDN services have been around for long, but still users often wonder:
how does it work? How are CDN providers different? I have worked in the hosting industry for the last 15 years and will discuss the principles of CDN and the difference between providers.
CDN is a network of servers that enables the delivery of static content to different points of the globe. Let’s figure it out in order.
By default, a site or project is located on the same server. This server is located somewherein a given city in the world, transmitting data all around the globe. CDN, transmits data through a network of servers, allowing for a faster data transfer. As an example, let’s pretend there is a server in London. Users from the United States could experience a greater delay in the delivery of content compared to those in the UK. By connecting a CDN with American servers (points of presence), the content will be transmitted through the CDN servers and thus speeding up its delivery to the end user. In other words, American users will ultimately receive content from US servers as much as Asian users from Asian servers. It all depends on the CDN geographical coverage.
An important nuance is that best route won’t always go through the nearest geographical location. CDN has its own routing algorithms, which guarantees the fastest content delivery, and, accordingly, the quality of work.
All standard CDNs operate on the principle of \”cache and distribute.\” The bottom line is that you store all files on your server as well. The first time a CDN link is accessed, it checks to see if the requested file is already in the CDN cache at the point of presence. If so, the CDN distributes the file from the point of presence. Otherwise, the CDN requests a file from the source server, and distributes it from its cache to the end location.
Let\’s look at another example. We connect site.com to the CDN, which contains a picture in an address like site.com/image.jpg. After connecting and configuring the CDN, this image may be available in another address such as cdn.site.com/image.jpg.
When the end user opens the link cdn.site.com/image.jpg, the CDN checks to see if this picture is cached at the point of presence. If so, then it distributes it. Otherwise, it takes the image from site.com/image.jpg, caches and distributes it.
Thus, the first time you connect, you need to wait a bit until all the content is cached and will be distributed via CDN, since the first requests will be accompanied by calls to the source server in one way or another.
It is also worth noting that some providers provide storage space to download files that will be delivered via CDN. Access to the space is via the FTP protocol. Storage itself is not free, so it should be considered carefully when choosing a CDN provider, as for some providers it is necessary for the correct operation of the CDN.
What files does it work with
Any site consists of dynamic and static content. While dynamic content can include script files, static content includes images, on demand streaming videos, and other media. CDNs focus on the latter.
In the case of streaming, there are many nuances, so it is strongly recommended that you first clarify the technical ability of the CDN provider to work with a particular stream format. As a rule, providers have special paid streaming options such as transcoding, working with different bitrates, and many more.
HLS streams, don’t require any options, allowing us to use CDN for its intended purpose: caching and static content delivery. In fact, HLS streams are composed by m3u8 playlists, as well as many small ts fragments.
All CDN providers support HTTPS conditionally. Almost all provide HTTPS links for free and without needing to download software: just set up the CDN in the panel and you’ll receive long link like cdn-provider.user11111.com/image.jpg. The types of links vary by provider, but the principle is the same.
Typically, most users want to use the CNAME option. Almost all providers provide it for free. However, downloading a certificate for a select CNAME is a must. For example, if you want to use the cdn.site.com domain, you will need to download an SSL certificate for it. You can use wildcard certificates issued for * .site.com and will need to make an appropriate entry in the domain registrar by directing CNAME to the service link provided by the provider.
Providers like Verizon support HTTPS only on a paid basis.
When calculating traffic and billing, note that HTTP traffic and HTTPS traffic are considered and paid separately, so everyone is strongly advised to switch from one protocol to another only on the first or last day of the month to avoid double billing.
Additional options and settings
CDN providers panels as well as their provided options vary vastly. These allow you to configure everything down to the smallest detail. While some functions are enabled only through support, others can be configured independently individually. Most necessary options from providers are free, with the exception of a top provider like Verizon, with most additional functions activated only after prepaying for their integration.
Choosing a CDN solution that suits your case is not an easy task. Each provider has its own requirements, features, additional payments and much more. Services are very individualized and require expertise in hosting area. INXY experts will help you find a CDN provider and choose the best solution for you for the price and required functionality. We are available any time and will be happy to help you setup and connect!