DEV Community

itsharshag
itsharshag

Posted on • Edited on

Introduction to Content Delivery Networks

Unless you are Warren Buffet, you will most likely need a fancy website with images, videos, and unique styles to capture the attention of your audience. But usually all of this can sum up to a lot of data. Images and videos are heavy. CSS and JS code combined for even a regular website can be a significant amount.

To reduce the load of all of these things that you can put in public and ensure fast delivery to the people who are viewing your website, you can use a CDN (Content Delivery Network). A CDN is designed to deliver all static assets of a website like images and videos to end users at a fast speed.

CDNs are a globally distributed set of servers that cache your static assets whenever any user visits your website for the first time. All the subsequent requests from that user and other users will be a lot faster because they will be receiving a cached copy of the asset. CDNs are geographically located in a higher number of locations, and that ensures that your user will receive the cached as quickly as possible. The load times for images, videos, and styles will be reduced, and your users will have a better experience.

Unless you are deploying your applications on the edge, most application servers are present in only one or just a couple of locations. Even if you're deploying on the edge, using a CDN to serve static assets is a better choice as it reduces the number of requests on your servers and reduces the load on your application servers.

A couple of widely used CDNs are Cloudflare, Amazon CloudFront, and Akamai CDN.

I like to use Cloudflare because it's free and has a great onboarding experience. I use it for a number of my projects. I connect Cloudflare to a public bucket on BackBlaze and then when once the cache gets built, Cloudflare serves assets at fast speeds.

This is a great article on how to connect a BackBlaze bucket to Cloudflare to cache assets for your website: https://help.backblaze.com/hc/en-us/articles/217666928-Using-Backblaze-B2-with-the-Cloudflare-CDN

Top comments (6)

Collapse
 
nikmikhailov_ profile image
Nik Mikhailov

Good article. Does Cloudflare have a free CDN for a certain period?

Collapse
 
itsharshag profile image
itsharshag

Yeah. Cloudflare's CDN allows unlimited usage for any period of time. cloudflare.com/plans/#overview
If you see the above pricing page, it says that the free plan includes the CDN. I have been using the CDN on free plan without any issue.

Collapse
 
honorbertt profile image
Ho Norbert

No, they just have a free plan. But I would not recommend using them, too many cons. And if you are working with the CDN for the first time, it will be difficult to figure out how to set it up correctly.

Collapse
 
itsharshag profile image
itsharshag

Would love to know the cons. I personally found Cloudflare CDN easy to set up.

Collapse
 
nikmikhailov_ profile image
Nik Mikhailov

Who can you advise for the first use? I'm also interested in free. I have a small WordPress blog.

Thread Thread
 
honorbertt profile image
Ho Norbert

For Word press, G-core will be perfect. They also have a free plan, plus they have good free protection. But most importantly for you - they are easier to set up and have a responsive support team.