What is CDN (Content Delivery Network) and How does it Works ?

What is CDN (Content Delivery Network) and How does it Works ?

This article answers the question, “What is a CDN?” A CDN (Content Delivery Network) is a great way to boost your website’s speed, availability, and performance.

It’s a system made up of servers distributed across the globe, each holding a cached copy of your website’s static content. When a user visits your site, the server geographically closest to them delivers that static content, cutting down on load time.

Content Delivery Network also provides security from various attacks like SQL injection and denial of service (DOS) and keeps your website safe.

What are Static Contents ?

The static content of a website includes – CSS files, JavaScript, Fonts, Video/Audio files, Plain HTML, Downloadable files and Images. These things stay the same for every user and don’t change unless a developer or content owner manually updates them. The server sends the exact same file to everyone who requests it — no processing, no database queries, no per-user customization.

This is exactly why CDNs are so effective for this kind of content: since a static file doesn’t change per request, it can be cached at edge servers around the world and served identically to any user, anywhere, without needing to check back with the origin server each time.

This is the opposite of dynamic content — things like a personalized dashboard, search results, or a shopping cart, which are generated on the fly by the server based on the specific user, their session, or a database lookup, and therefore can’t be cached and reused the same way across different visitors.

Not just websites!

Content Delivery Network serves all types of web objects (text, graphics and scripts), downloadable objects (media files, software, documents), ecommerce portals and many more from the world of internet.

How CDN Works ?

If your website isn’t using a CDN, users visiting it are served directly by your web hosting server. This server, which can be located anywhere in the world, is responsible for delivering your website’s content to every visitor, regardless of where they’re coming from — the United States, the UK, India, China, or anywhere else.

At normal traffic levels, the website loads fine. But when traffic gets very high (greater than 100K), the load increases and this drags down the site’s loading speed — it may even crash.

A CDN works on top of your web hosting. Once your site uses one, all the CDN’s servers store a cached copy of your website’s static content.

So when a user visits your website, the server nearest to them (geographically speaking) delivers that static content. This applies to every user visiting your website. As a result, your web hosting server no longer has to serve static content itself, which significantly reduces its load.

A CDN also automatically load-balances traffic during high-traffic periods, so your website’s speed isn’t affected.

CDN vs No-CDN

CDN reduces the Round-Trip Time (RTT)

The physical distance between the user and the host serving the resource gets reduced. Take, for example, a user from London, United Kingdom, visiting your website.

Now suppose your web hosting is located in Phoenix, Arizona. Without a CDN, the Phoenix server handling your web hosting serves the website’s content directly to that user. The distance between the user and the web hosting server is quite large, so the round-trip time (RTT) increases by a few milliseconds.

With a CDN, however, the CDN’s London-based server serves the resources to the user instead. This reduces RTT, saving a few milliseconds in loading speed. The logic is simple: the closer the server is to the user, the faster the website loads.

Round-Trip Time

Round-trip time (RTT) is an important factor deciding the loading speed of a website. When a user visit a website, first the browser sends a request to the web server. The server then sends a response back to the browser.

Round-trip time (RTT)

The time taken for this job is known as Round-trip time (RTT).

RTT depends upon a number of factors like:
  • 1. Distance between the user and the server.
  • 2. Type of transmitting medium (copper wire, optical fibres, wireless, etc).
  • 3. Number of Intermediate Node in the path.
  • 4. Amount of traffic.

Calculations – Suppose a web page on our website is visited by a person in London. This page contains 100 objects — references to JavaScript files, images, videos, and so on — so the user’s browser has to make 100 requests to the web server.

If you want to want your website’s content should be read by millions of online reader then you should have RSS System installed in your website. For RSS you will need FeedBurner too, so kindly check this tutorial – What is FeedBurner and expose your website’s content.

With a CDN, the RTT of each request is reduced by roughly 10 to 15 milliseconds. Across 100 requests, that adds up to speeding up the page’s load time by up to 1.5 seconds. Not bad for a single optimization.

Why you need CDN for Website?

Why Need CDN

CDN makes a huge impact in your website loading performance. Other than that it also help in other things like –

  • Speed – Your website will run up to 4 times faster with CDN. Most of the web pages loads in under 1 seconds only.
  • Crash Resistance by Load Sharing– With multiple servers in CDN, the load, during large website traffic is shared among these servers. This prevent the website from crashing.
  • Improved User Experience – A fast website will give better user experience. People will view multiple pages and will not leave the website soon (as seen in websites with poor loading speed). This increases page views and decreases the bounce rate.
  • SEO Boost– Search engines notices the website loading speed and tend to give top rankings in SERPS for fast loading pages. Thus your fast loading website will get benefit in rankings.

Free CDN

Every website owner should use a CDN for faster page loading and a better user experience. On average, new users spend less than 1.5 seconds on a website before deciding whether to stay.

If they don’t get a good experience in that time, chances are they won’t return. For those who can’t afford a paid CDN service, plenty of free CDNs are available to use.

Free CDN

We will discuss 3 top CDN available –

CloudFlare

The best CDN and which offers so many features including optimization, security, DNS & multiple apps. More than 2 million websites use CloudFlare CDN today. CloudFlare CDN is free to use

Check our article on How does ClouldFlare works which covers everything about it in details.

JetPack Photon

Jetpack is a common name associated with WordPress websites. It is a single plugin which provided many features like image CDN, prevents malicious attacks & publicize your posts.

Click Here to download and install Jetpack in your WordPress website. Then activate its Photon (image CDN) Module.

Keycdn

It is another very good CDN service speeding millions of websites around the globe. It is also simple and fast to use in your website.

You can try it free for 30 days by creating your account (no need to add your credit card). Click Here to go to Keycdn website.

Speed Up WordPress

CDNs are a great way to speed up WordPress websites. There are also other optimization techniques that can help you speed up your site even further. These include:

  • Caching – Static parts of a website that don’t change often — like CSS files, JavaScript and Images— can be cached, meaning they’re stored in the user’s browser so they don’t need to be downloaded every time the user visits the website.

    Caching is especially useful when a user returns to your website: those static parts, already stored in the browser as temporary files, don’t need to be re-downloaded, which speeds up the site.

    WordPress website owners can simply install the W3 Total Cache plugin, which handles caching automatically.
  • Image Optimization – When you use images on a WordPress post then the size of the page increases by a good percentage.Use image optimization plugins like WP Smush – Image Optimization which compress the images and makes them smaller size.

    If you are using too many images then to speed Up the website use Lazy Load Plugin which does not loads the images that are not visible on the view-able screen area (unless user scrolls down the page and reaches those images).

    It not only speed up WordPress websites but also saves bandwidth when users do not scroll down the full page up to the bottom.

  • Database Optimization – Remove unnecessary database entries like post revisions, spam comments, trackbacks and pingbacks, draft posts and other unnecessary database object. This optimizes the database and increases the loading speed of your WordPress Website.

    A good database optimization plugin is WP-Optimize

SHARE THIS ARTICLE

  • linkedin
  • reddit
yogihosting

ABOUT THE AUTHOR

I hope you enjoyed reading this tutorial. If it helped you then consider buying a cup of coffee for me. This will help me in writing more such good tutorials for the readers. Thank you. Buy Me A Coffee

Leave a Reply

Your email address will not be published. Required fields are marked *