What is a CDN and Why would I Need it?

What is a CDN and why would I need it 1

Most websites and applications interacted by users on a daily basis normally run from one physical location.

But, the content present on these websites and applications (like images, text, and videos) require to be moved through wires. This is needed for being able to reach different corners of the world.

Let’s go further.

Say the location of your site’s server is in Melbourne; if your target customers reside in a city similar to it, then they will be able to get the content quickly as compared to people located in some other city.

Remember this always, if your clients are far from the data centres, the loading of your WordPress website or application will be slow. This will cause inconsistency and frustration to your users.

Web and mobile users will find it very frustrating, especially when they are running short of time and they are used to having real-time experience. As per research done:

  • If the loading of a site takes over 3 seconds, then approximately 30 per cent of your site users will exit. 
  • If any mobile website loads after 4 seconds, nearly 74 per cent of its visitors will leave the site.
  • Based on statistics, over 46 per cent of your site users will not look back at your WordPress site if it performs poorly.

Fortunately, CDN has a lasting fix for this problem.  

What is a CDN?

CDN stands for Content Delivery Network. It’s a quick and efficient way of delivering content to your visitors using mobile applications and websites. Content Delivery Network (CDN) is basically a large network of multiple servers situated in different locations across the globe.

If a CDN server is near to your site’s visitor, then it is known as “edge server”.

Thus, when certain content is requested by your visitors from your site, and it is delivered using a Content Delivery Network (CDN), they’ll access the nearest edge server to the location. This way, the visitors of your site will have a good and satisfying experience online.

Say suppose you’re based in Melbourne and need a picture from a server located approximately 3,098 miles far from you. This will normally take 200 ms approximately to send the request and get a reply.

But, if you ask for a somewhat identical image from a server that is only 58 miles away from you, this may only take 10 ms approximately to send your request and get the reply.

This means it is around 20 times better and quicker than the first scenario. But, this difference is undetectable as we are talking about milliseconds here.

This undetectable difference becomes important if you want the web page to include data that is over 2 MB and spread out over thirty requests.

Few simultaneous requests are made by the browser, each of which demands several roundtrips to the server.

This adds these milliseconds to many seconds, which naturally gets the website slowed down. 

How does a CDN Work? 

When your website slows down, it results in dissatisfied customers. To avoid such situations, we have CDN.

It helps in moving the content nearer to your site visitor. This helps decrease the latency and improves the experience of the visitors.

Though it may sound pretty neat and simple, it is not. It involves some terrifying technical difficulties.

If you want to reduce the response time for a certain customer, the Content Delivery Network (CDN) should contain a server for caching content, preferably one that is near to the customer. But, it is impossible to have a cache closer to each and every visitor.

POPs have caches organized in them. This helps in spreading them widely to vast geographic regions, which include America, Asia, Europe, and so on.

Then, they are placed in centres that are highly populated within those particular regions.

After that, a request given by a site visitor has to be directed to the nearest POP by the CDN. Most Content Delivery Networks do this by using a very helpful technology called GeoIP.

It looks like a huge lookup table. It maps IP (Internet Protocol) addresses to different geographic areas like countries, cities, and so on.

The CDN refers to this table when processing a request and then routes the user’s web traffic to the closest server that is available.

CDN Caching Content 

If you want to cache, which means you want to have the content stored temporarily on CDN, it’ll get delivered to your end-users faster from the edge as compared to it getting provided from the location of origin server.

When you use a CDN, it means that if there is a visitor who wants to access your website or mobile application data, his or her request for the same will go to the closest POP instead of going to the source server and then return.

You can compare a cache to a very big store of prime value. The minute the visitor’s request reaches, the cache will try to understand the visitor’s request details, find the requested content, and then provide it to the visitor.

A portion of the data requested is made up of several parts. This is used to ascertain which information must be provided.

Things that it could include are headers, query, path, parameters, domain name, and so on.

The cache is used at various levels of lookup tables also. These tables use algorithms that have been optimized to help to locate the content requested quickly.

Also, CDNs constantly remove and update data. This is done so that the relevant and latest data is supplied.

The other word for this is Content Invalidation. This helps many businesses to get the data updated on a regular basis.

Benefits of CDN 

All who own a website or mobile application that multiple users access simultaneously will find the CDN very helpful.

Complex websites having multiple users at different locations will benefit from a CDN. There are numerous benefits that one can enjoy when they choose a CDN. Some of these are:

  • Web and mobile users will notice faster load times. 
  • Heavy traffic websites will scale quickly.
  • Website stability is ensured by making sure to reduce the traffic surges risk at the source.
  • Traffic offloading is done, which helps in reducing the infrastructure cost. There is less load on the origin server.  
  • Website performance will improve.  

Apart from these, there are few other certain benefits that CDN provides to different types of businesses and organizations. These are:

1. SaaS & Technology 

Now, Technology sites can make requests over millions every day. There will be no compromise in the performance because of CDN.

2. Media or Publishing  

Media websites have to deliver timely and up-to-date information. CDN can help media companies to update headlines and news.  

3. Mobile Applications 

For mobile applications, the CDN provides dynamic content based on location. This help reduce the load times while simultaneously improving responsiveness.

4. E-commerce

Content can now be provided by Ecommerce websites quickly and efficiently by using CDN services. Even websites with heavy traffic on Black Friday and holidays can now handle the sudden surges in the traffic.

5. Finance 

By using CDN services, banking/financial institutions can offer a reliable, quick and secure infrastructure that could help to deliver information that is sensitive to their consumers and analysts.

6. Government 

Large websites and those having heavy content can get sensitive content delivered to citizens more quickly and efficiently by using CDN.  

Traditional CDNs as Compared to Modern CDNs 

CDNs have been around since the 90s. But, traditional CDNs are way behind when it comes to hardware and technology. Hence their benefits differ from those offered by modern CDN.

Previous CDNs had some vital inefficiencies which have been improvised upon by the modern CDN. These are:

1. Static Content Caching

Traditional CDNs could only cache static content, which is easy as the base on your customer’s input remains unchanged. Few examples of static content are CSS, JavaScript, images and video.

While dynamic content has content that changes frequently and that needs the logic of the server, like updating the shopping cart of a customer on an online store or activities related to credit cards, etc. 

The categorization of dynamic content is “uncacheable”. It holds sensitive data; therefore, it must go through the source server.

Dynamic data definitely has vast portions. But, data can be cached by you only if it doesn’t include personal data.

This, however, changes frequently and is unpredictable. This type of data is driven by an event that occurs as a result of human or machine actions.

News headlines of importance, sports scores requiring instant updating, comments of users on some particular article, large stock prices will be considered as “uncacheable” by many CDNs.

2. Limited Storage Space on the Edge

The majority of traditional CDNs only provide a small amount of edge real estate. This is mainly because they are dependent on hard drives that spin.

In other words, they have to prioritize data that must be cached on the edge and data that must be further cached. Most of the time, large websites get prioritized over smaller ones.

Modern CDN construction is done on a huge SSD network. A lot of content can be cached by them on the edge. This benefits each of their clients.

3. Reverse Proxying 

A main benefit of the modern CDN is reverse proxying. Traditional CDN users have to get the data uploaded directly initially to cache servers.

Modern CDN gets the data and stores it from their customer’s source server when requested. Hence, there is no need to have the cache servers front-loaded.

Websites that use a traditional CDN must ensure that dynamic data is kept on the source server. This slows the performance when traffic increases. This defeats the main reason for using the CDN.

Security Considerations 

CDNs have been around for since long. But, they all are not the same. It is nothing new for a CDN to create its own rule for handling website traffic. You may wonder why.

Well, CDN was created when HTTP was not defined. To make improvements to it, few companies, along with different other platforms, are working on getting the CDN basic protocol standardized.

A few years back, some researchers had observed important concerns faced by engineers when they were working on CDN. It’s possible to direct CDNs competing with one another in order to get them overthrown.

Malicious customers can attack the CDN availability because of forwarding loops that are created across different CDNs or within one CDN. These loops can process one request repeatedly or sometimes indefinitely.

As a result, resources are being wasted, potentially leading to a DDoS attack. Our team evaluated the attacks of these forwarding loops and found more than 15 very popular CDN providers that are vulnerable to such attacks. 

This problem is scary. This is due to the huge volume of many CDNs with link capacities of TB per second. This is available worldwide to all.

Hence if an accidental misconfiguration or an intended attack happens, it could overthrow huge businesses.

Therefore, a CDN that is well configured will help in protecting websites from malicious attacks such as DDoS.

Advanced Technology that is Upcoming

We are looking for something better. This made us talk to our colleagues who use other Content Delivery Networks, and different content platforms.

The outcome from this was really amazing. A small CDN specification – a request header loop in the working group of HTTP.

This was approved as an RFC standard for all publications by the IESG. This is a very simple mechanism.

Implementation of CDN is needed. You should add it to each request made in order to protect it from accidental modifications that detect and mitigate any loops reliably, even though there are different CDNs in the loop.

We are happy with this step. This is a very positive change. Though this step is small, it definitely is an important one saying that the sector is all set to work together.

Conclusion

In this write-up, we’ve covered various aspects that explain about a CDN, the several benefits it provides, how it operates, and the different risks involved.

We hope this post has provided you with some insight. Please send us your comments. Thanks. You can also check our article on What is a Registrar? (What are they? How do Domain Names Work? etc.)

Leave a Comment