WP What is a CDN? How does a CDN Work? | Imperva

What is a CDN

572.9k views
CDN Guide

Content delivery networks (CDN) are the transparent backbone of the Internet in charge of content delivery. Whether we know it or not, every one of us interacts with CDNs on a daily basis; when reading articles on news sites, shopping online, watching YouTube videos or perusing social media feeds.

No matter what you do, or what type of content you consume, chances are that you’ll find CDNs behind every character of text, every image pixel and every movie frame that gets delivered to your PC and mobile browser.

To understand why CDNs are so widely used, you first need to recognize the issue they’re designed to solve. Known as latency, it’s the annoying delay that occurs from the moment you request to load a web page to the moment its content actually appears onscreen.

Imperva CDN Guide: What is a CDN

That delay interval is affected by a number of factors, many being specific to a given web page. In all cases however, the delay duration is impacted by the physical distance between you and that website’s hosting server.

A CDN’s mission is to virtually shorten that physical distance, the goal being to improve site rendering speed and performance.

 

How a CDN Works?

To minimize the distance between the visitors and your website’s server, a CDN stores a cached version of its content in multiple geographical locations (a.k.a., points of presence, or PoPs). Each PoP contains a number of caching servers responsible for content delivery to visitors within its proximity.

In essence, CDN puts your content in many places at once, providing superior coverage to your users. For example, when someone in London accesses your US-hosted website, it is done through a local UK PoP. This is much quicker than having the visitor’s requests, and your responses, travel the full width of the Atlantic and back.

This is how a CDN works in a nutshell. Of course, as we thought we needed an entire guide to explain the inner workings of content delivery networks, the rabbit hole goes deeper.

Read on to learn more!

Every Second Counts

Studies show that a second-long delay causes a 7% drop in conversions, an 11% drop in page views and a 16% drop in customer satisfaction.

Who uses a CDN?

Pretty much everyone. Today, over half of all traffic is already being served by CDNs. Those numbers are rapidly trending upward with every passing year. The reality is that if any part of your business is online, there are few reasons not to use a CDN especially when so many offer their services free of charge.

Yet even as a free service, CDNs aren’t for everyone. Specifically, if you are running a strictly localized website, with the vast majority of your users located in the same region as your hosting, having a CDN yields little benefit. In this scenario, using a CDN can actually worsen your website’s performance by introducing another unessential connection point between the visitor and an already nearby server.

Still, most websites tend to operate on a larger scale, making CDN usage a popular choice in the following sectors:

  • Advertising
  • Media and entertainment
  • Online gaming
  • E-commerce
  • Mobile
  • Healthcare
  • Higher educatio
  • Government

So What Can a CDN Do for Me?

Modern CDNs can handle numerous IT tasks, helping you to:

  • Improve page load speed
  • Handle high traffic loads
  • Block spammers, scrapers and other bad bots
  • Localize coverage without the cost
  • Reduce bandwidth consumption
  • Load balance between multiple servers
  • Protect your website from DDoS attacks
  • Secure your application
  • And more
 

CDN Building Blocks

Imperva CDN Guide: PoPs (Points of Presence)

PoPs (Points of Presence)

CDN PoPs (Points of Presence) are strategically located data centers responsible for communicating with users in their geographic vicinity. Their main function is to reduce round trip time by bringing the content closer to the website’s visitor. Each CDN PoP typically contains numerous caching servers.

Imperva CDN Guide: Caching servers

Caching servers

Caching servers are responsible for the storage and delivery of cached files. Their main function is to accelerate website load times and reduce bandwidth consumption. Each CDN caching server typically holds multiple storage drives and high amounts of RAM resources.

Imperva CDN Guide: SSD/HDD + RAM

SSD/HDD + RAM

Inside CDN caching servers, cached files are stored on solid-state and hard-disk drives (SSD and HDD) or in random-access memory (RAM), with the more commonly-used files hosted on the more speedy mediums. Being the fastest of the three, RAM is typically used to store the most frequently-accessed items.

Start Using a CDN

For a CDN to work, it needs to be the default inbound gateway for all incoming traffic. To make this happen, you’ll need to modify your root domain DNS configurations (e.g., domain.com) and those of your subdomains (e.g., www.domain.com, img.domain.com).

For your root domain, you’ll change its A record to point to one of the CDN’s IP ranges. For each subdomain, modify its CNAME record to point to a CDN-provided subdomain address (e.g., ns1.cdn.com). In both cases, this results in the DNS routing all visitors to your CDN instead of being directed to your original server.

If any of this sounds confusing, don’t worry. Today’s CDN vendors offer step-by-step instructions to get you through the activation phase. Additionally, they provide assistance via their support team. The entire process comes down to a few copy and pastes, and usually takes around five minutes.

Diagram for using CDN

Imperva CDN Guide: Start Using a CDN

Why isn’t a CDN a Default Part of my Website Hosting?

In an ideal world, a CDN would be an integral part of any website hosting. However, when CDNs were first established in the late 1990s, they were far too expensive and only accessible to the largest organizations.

Today things have changed and many hosting providers actually do offer CDN services as a checkbox add-on.

The Evolution of CDNs

Commercial CDNs have been around since the ’90s. Like any other decades-old technology, they went through several evolutionary stages before becoming the robust application delivery platform they are today.

The path of CDN development was shaped by market forces, including new trends in content consumption and vast connectivity advancements. The latter has been enabled by fiber optics and other new communication technologies.

Overall, CDN evolution can be segmented into three generations, each one introducing new capabilities, technologies and concepts to its network architecture. Working in parallel, each generation saw the pricing of CDN services trend down, marking its transformation into a mass-market technology.

Imperva CDN Guide: The Evolution of CDNs
1997
1st Gen

Static CDN

  • Content served

    Static HTML and downloadable files

  • Caching method

    Origin push

  • Network topology

    Scattered

  • Agenda

    Performance

  • Pricing

    Very expensive

  • Customer

    Corporate sector

2001
2nd Gen

Dynamic CDN

  • Content served

    Static and dynamic content, including rich media

  • Caching method

    Many are origin pull

  • Network topology

    Consolidated

  • Agenda

    Performance and availability

  • Pricing

    Expensive

  • Customer

    Business sectors

2010
3rd Gen

Multi-Purpose CDN

  • Content served

    Static and dynamic content, including rich media

  • Caching method

    Most are origin pull

  • Network topology

    Highly consolidated

  • Agenda

    Security, performance and availability

  • Pricing

    Affordable

  • Customer

    Anyone with a website

 

Reverse Proxy

Content delivery networks employ reverse proxy technology. Topology wise, this means CDNs are deployed in front of your backend server(s). This position, on the edge of your network perimeter, offers several key advantages beyond a CDN’s innate ability to accelerate content delivery.

Today, the reverse proxy topology is being leveraged by multi-purpose CDNs to provide the following types of solutions:

Imperva CDN Guide: Website Security

Website Security

Cybersecurity is all about managing outside access to your protected perimeter, ideally blocking all threats before they can even set foot on your doorstep.

Deployed on the edge of your network, a CDN is perfectly situated to act as a virtual high-security fence and prevent attacks on your website and web application. The on-edge position also makes a CDN ideal for blocking DDoS floods, which need to be mitigated outside of your core network infrastructure.

Imperva CDN Guide: Load Balancing

Load Balancing

Load balancing is all about having a “traffic guard” positioned in front of your servers, alternating the flow of incoming requests in such a way that traffic jams are avoided.

Clearly, a CDN’s reverse proxy topology is ideal for this, as is the default recipient of all incoming traffic. In addition, reverse proxy topology also provides a CDN with enhanced visibility into traffic flow. This lets it accurately gauge the amount of pending requests on each of the backend servers, thereby enabling more effective load distribution.