What is a CDN and Why would I Need it?

What is a CDN and why would I need it 1

Many applications and websites that users interact with daily tend to run out of a single physical location. However, the content on these applications and websites (like videos, text and images) must travel via wires to reach different regions of the world.

So this is how it works. If your website’s server is in Quebec, and your target audience is in a similar city, they will receive the content quicker than those in other locations.

Always remember if your customers are away from your data centers, your application or website will load slower. This will create inconsistency and frustrate your users.

Lack of time can be extremely frustrating for mobile and web users that are used to real-time experience. According to research;

  • If a website takes more than three seconds to load, approximately 30% of visitors will exit the website. 
  • If a mobile website takes more than 4 seconds to load, approximately 74% of visitors will exit the mobile site.
  • Statistics have also proven that more than 46% of your visitors will not return to your website that performs poorly.

Luckily this issue has a permanent fix with CDN.

Let’s understand what CDN is;

The full form of CDN is a Content Delivery Network. It’s a brilliant way to deliver the content to your users via mobile apps or websites in a more timely and efficient manner.

CDN is an extensive network of multiple servers in various locations spread around the globe.

A CDN server that is close to your visitor is called an “edge server”. In this way, when your visitors request certain content from your website, this will be served via a CDN. The CDN will connect to the edge server closest to the location. In this way, your visitors have a satisfactory online experience.

Now suppose you are in Quebec, and you have requested a picture that is on the server located in London. It is 3098 miles away. Typically, this will take approximately 200 ms to send a request and receive a response. 

If you request a similar image from the server in Clinton, MS, which is about 58 miles from Quebec. It will take around 10 ms to send a request and receive a response.

It is almost 20 times faster and better than the previous case. However, since we are speaking about milliseconds, the difference is unnoticeable.

But this difference is significant if the web page includes more than 2 MB of data that are spread over 30 requests. Now the browsers make a very small amount of simultaneous requests.

Each of these requests involves multiple roundtrips to a server. This adds these milliseconds to numerous seconds that slows down the website. 

How Does it Work? 

In order to avoid dissatisfied customers that are created due to the slow service, Content Delivery Network (CDN) moves the content close to the visitor. This, in turn, helps reduce the latency. This improves the visitor’s experience.

All this sounds self-explanatory, elegant, and neat. But this actually involves some dreadful technical challenges.

To begin with, If you need to reduce latency for a specific visitor, the Content Delivery Network (CDN) needs to have a server with content caching. A cache that is pretty close to the visitor. However, it is not possible to arrange a cache close to every user.

So caches are organized into PoPs. This is done in order to spread them out throughout huge geographic regions that include Asia, America, Europe etc. They are then placed in highly populated centers that are within those specific regions. 

Later, a given request by one visitor needs to be directed by the CDN server to one of the closest POP. Many CDN’s get this done by utilizing a very useful technology known as GeoIP.

This technology is sort of an enormous look-up table. It maps out IP addresses to various geographic regions like cities, countries, etc. Hence, while processing a request, the CDN refers to this table. Then directs the traffic of the user to the nearest available server.

CDN Caching Content 

If you plan to cache or store content temporarily on a Content Delivery Network (CDN) server. It will be sent to end-users from the edge way faster compared to if it were delivered from the place of origin.

What does utilizing a CDN service means? If a visitor tries to obtain data from your mobile app or website. The visitor’s request for the content will be routed to the nearest POP and returned. It will not go to the origin server and return.

A cache can be compared to a huge prime-value store. The cache’s job begins as soon as a request arrives. It determines the details of the user’s request, locates the information, and returns it to the user.

A piece of the requested information has multiple parts that are utilized to determine which data needs to be served. This includes things such as domain name, headers, query parameters and path.

The cache is also employed at multiple levels of look-up tables. These tables utilize algorithms that are optimized to locate the right content in a short period of time.

In addition, CDN’s update and remove data constantly. This is done to ensure that the latest and relevant data is delivered. This is also called Content Invalidation. It allows various businesses to regularly update the data.

Advantages of Using CDN 

Anyone who has a mobile app or a website that is likely to be accessed by numerous people simultaneously will benefit greatly from using it. A Content Delivery Network (CDN) is very useful to websites that are complex and have multiple users across various locations.

Also, the ones using mobile apps and websites with plenty of dynamic data. Now Content Delivery Network (CDN) can provide numerous benefits to your website. Some of them are mentioned below:

  • Mobile and web users will experience quick load times. 
  • If your website faces heavy traffic, it will be able to scale quickly. 
  • It also ensures website stability by reducing the risk of traffic surges at the origin.
  • Traffic is offloaded, and this leads to a reduction in the cost of infrastructure. The origin has less load.
  • Your website will perform better. 

There are also certain specific advantages that Content Delivery Networks offer to various types of organizations and businesses, they are; 

SaaS and Technology 

Technology websites can now make millions of requests every day to use without compromising on performance. All thanks to CDN.

Mobile applications 

Location-based dynamic content for mobile apps is now delivered by CDN server. This reduces load times and increases responsiveness.

Publishing or Media 

Up-to-date and timely information has to be delivered by media websites. Media companies can update news, and headlines can now be done with the help of CDN’s. 

Finance 

With the help of CDN, banking institutions are now offered fast, reliable and secure infrastructure.

This helps them to deliver sensitive information to their analysts and consumers. 

Government 

Content-heavy, large websites can now deliver sensitive content to citizens efficiently and quickly with the help of CDN.

E-commerce

Ecommerce websites can now deliver content efficiently and quickly with the help of CDN.

Even if these sites experience heavy traffic during the holidays and Black Friday, they can handle sudden traffic surges.

Traditional CDNs vs. Modern CDNs 

Since the 90s, Content Delivery Networks have been in the market. However, traditional CDNs lag behind in terms of both technology and hardware. Hence they cannot offer similar benefits in comparison to modern CDNs.

Legacy CDNs are usually not created in an agile software environment. Legacy CDNs are typically not created in an agile software environment. This form continuously repeats on products, improves them and incorporates all their customers’ feedback.

Now CDNs have been in the market for years together with nomad change. They also have certain vital inefficiencies that the modern CDN have improvised:

Caching of Static Content 

The traditional CDNs could just cache only static content that is straightforward. This is because it does not change the base on the user’s input. Some of the examples for static content are things such as JavaScript, CSS, video and images.

Whereas dynamic content includes content that frequently changes and needs server logic. That is, updates made to a person’s cart on an online store or credit card activities. 

For instance, dynamic content is categorized to be” uncacheable”. Because it needs to be put through the origin server as it holds sensitive data.

I agree with it to a certain extent. Indeed there are vast portions of dynamic data, but you can cache – data that does not have personal data. However, it is frequently changing and pretty much unpredictable.

The dynamic data is event driven that is based on the action from a machine or a human. Sports scores, important news headlines that require instant updating, heavy stock prices and user comments on a particular article. Many CDNs will treat this data as “uncacheable.”

The Edge has Limited Storage Space  

Many traditional CDNs only give limited edge real estate to their clients. This is because they mainly depend on the hard drives that spin. This means that they’ll need to prioritize which data should be cached on the edge and the data which should be cached further in. Many times huge websites are offered priority over small ones. 

Now, the modern CDN is constructed on a massive network of SSD’s. They can cache plenty of content on the edge, therefore benefiting all their customers.

Reverse Proxying 

One of the most significant benefits of modern CDN services is reverse proxying. Customers using traditional CDN need to upload the data directly to cache servers initially.

Modern CDN servers fetches and stores data from their users’ origin server when it is requested. Thereby removing the requirement to front-load cache servers.

Sites that are utilizing traditional CDNs are compelled to keep the dynamic data within the origin server. This leads to slow performance when there is a spike in traffic. This defeats the purpose of using a CDN service.

Security Considerations 

CDNs have definitely been in the market for a very long time. However, they are not all alike. There are certain cloud platforms that are built on and beyond traditional CDNs. They move things onto the edge, and there are a couple of differences.

It is very common for a Content Delivery Network to make its own rule on how to handle web traffic. This is because CDN services were not created when they defined HTTP.

In order to improvise on it, certain companies are working along with various other platforms. This is done so that the basic protocol for CDN is standardized.

Some time ago, certain researchers had noticed the main concerns engineers were facing while working on CDN. It is very much possible to direct CDNs that are competing with each other in order to overthrow them.

The availability of CDN can be attacked by malicious customers. This is possible when forwarding loops are created within a single CDN or maybe across various CDNs too.

These forwarding loops process a single request repeatedly and sometimes indefinitely. This results in unwanted consumption of resources and could lead to a potential DDoS.

Our team has evaluated the practicality of these types of forwarding loop attacks and found over 15 very famous CDN providers to be vulnerable to these attacks. 

This is due to the huge scale of various CDN servers that have a link capacity of TB per second, available to all worldwide. It is an extremely scary problem.

So if it is a misconfiguration that is accidental or an attack that is intentional. Whatever the reason, it has the potential to overthrow huge pants off the internet with CDN and be questionable. Recently we were chatting with a CDN engineer. He happened to say that this is a significant issue that tends to keep him up at night.

Hence a well-configured CDN will help protect sites against malicious attacks like DDoS.

Upcoming Advanced Technology 

We were looking at getting something better, and that’s why we started speaking to some of our colleagues who use alternative CDNs and content platforms. The outcome was an amazing minute specification for CDN – loop request header in the working group of HTTP. This was sanctioned for all publications as RFC standards tracked by IESG. It’s an extremely simple mechanism.

CDN implementation is required and must be added to every request made. This may be done to secure it from any accidental modifications. This will allow it to mitigate and detect any such loops reliably, even if the loop contains various CDNs.

We are pleased about this step forward as it is a sign of a positive change. The coordination between several CDNs of varied issues hasn’t been much since their inception.

They are not so excellent at providing consistent and good experiences to their customers. Though it’s a small step, it is definitely a vital one signifying that the industry is ready to work together.

Now, this is the beginning!

Final Thoughts 

In this article, we have touched upon various ideas that explain what a CDN is. The multiple advantages they offer, how they work and the various risks involved.

We do hope that this article has helped you get clarity. Do share your feedback with us. Thanks. You can also check our article on How to Change a Domain Name of an Existing Website?

Leave a Comment