17 September 2022

What is a CDN? Why, when and how to use it for your website

CDN stands for Content Delivery Network. What is that? Do we really need it or is it just a trend? A simple explanation but not too much.

CDN is going to Content Delivery Network . What is that? Do we need it? Let's talk about the importance of this type of technology and how to improve the performance of a website using this approach.

Imagine you've just launched an online store with 10 products that you sell to a local audience. Go easy. Guests the your store using your local hosting provider and it's pretty fast as it is. If you are a caring person you will still decide to use an adequate software stack in order to remain with page opening speeds of less than two seconds and to give a satisfying user experience in order that your potential customer does not leave your site.

However, you will be calm enough and you will certainly not be worrying about customers coming from Brazil, the United States or Japan, because you don't have these customers.

Nothing to worry about, right? Yes, until you reach the next level of growth.

Also imagine that in a year your web shop has grown and now you have 10000 products sold globally, to remote destinations. Even if our planet is not that big, we still have to consider the physical connection to the Internet.

Your site which is hosted in an Italian datacenter starts getting many many views not only from your local target audience but also international traffic, including the above mentioned countries.

This is where the CDN comes into play. It helps us connect with our users anywhere on the planet. Whether you have an online store, business website, newsletter or blog. If you sell far away, you need to deliver your product images to your customers at an appropriate rate. Alternatively, your business suffers.

Why use a CDN?

Let's put it simple. The longer your page loads after a user requests it, the less likely they are to buy from you or even stay on your website.

A one second delay in page load time produces: 11% fewer page views, 16% fewer customer satisfaction, 7% fewer conversions. crazyegg. com

This annoying delay is called latency, a point where all website drop-offs occur.

Therefore, the CDN was invented to reduce the physical distance between the website user and the website hosting server.

Furthermore, it must be taken into account that for over a year now the speed of the site has become a very important ranking and positioning factor at SEO level. Google has officially specified as a site that is compliant with the Core Web Vitals and pass the field tests, have greater visibility and positioning by search engines.

PageSpeed ​​Insight Crux Passed

In short, a CDN can tangibly help the optimization and improvement of these parameters and produce an optimal user experience able to pass the tests of Core Web Vitals both for Desktop and especially Mobile devices, the latter devices such as smartphones and tablets which are now the main traffic source for over 80% of internet traffic.

Some technicalities but not too many

Primarily speaking, CDN is a group of servers located in different places around the world. To minimize the physical distance between your website and your user, you can choose to deliver it via CDN which would cache a copy of your content on each of their servers.

CDN nodes are typically spread across multiple locations, often across multiple Internet backbones. Benefits include lower bandwidth costs, improved page load times, and increased global content availability. The number of nodes and servers that make up a CDN varies by architecture, some reaching thousands of nodes with tens of thousands of servers on many remote points of presence (PoP). Others build a global network and have a small number of geographic PoPs. [4]

Content requests are typically algorithmically routed to nodes that are somehow optimal. While tuning performance, you can choose the best locations to serve content to the user. This can be measured by choosing locations that are the least number of hops, the least network seconds from the requesting client, or the highest availability in terms of server performance (both current and historical), to optimize delivery across networks. locals. When optimizing the cost, you can choose the least expensive locations instead. In an optimal scenario, these two goals tend to align, as i perimeter servers close to the end user at the edge of the network can have a performance or cost advantage.

Most CDN providers will provide their services on a variable and defined set of PoPs, depending on the desired coverage, such as US, International or Global, Asia Pacific, etc. These sets of PoPs can be called "edges", "edge nodes", "edge servers" or "edge networks" as they would be the closest edge of the CDN resources to the end user.

How to implement a CDN?

The first thing you need to do is choose from the large variety of options. Above all, you need to consider your needs and resources as the implementation could take a long time e money.

  • CDN for large, heavily loaded websites. Choose a large CDN provider and manually configure it for your website. There are many different solutions for this on the market. CloudFlare, Google CDN, MaxCDN, Amazon CloudFront, CoralCDN just to name a few. You should set up the connection between your hosting provider and the CDN of your choice.
  • CDN for small to medium sized websites. Choose CDN hosting if your website isn't that big and doesn't grow much on a daily basis. Suitable for business website, blog, personal website. Some hosting companies provide CDNs as part of their service. Indeed this option is excellent for small to medium sized websites. You can activate this option quite quickly when you need it.
  • CDN for rapid scalability and automation. New generation CDN, fits all sizes. Perfect for fast growing businesses, startups, and fast-scaling businesses. Choose one CDN-based SaaS solution if you have a chance to experience rapid growth or if you want to save on implementation. This type of CDN also has a feature benefit that it brings with it when you sign up.

For example, an Image Processing CDN can help you process your images, to perform resizing and optimization or maybe even provide optimized formats such as Webp to compatible browser clients.

Even more benefits

In addition to worldwide distribution and enchanted latency, there are a few other benefits that CDN can provide:

  • SEO improvement. Google and other search engines love fast and efficient websites. Speed ​​is among the most important ranking factor for Google's SEO. The better the speed, the better a website can be seen in search. So, therefore, more leads and sales he can acquire.
  • Scalability. It protects your website from traffic spikes that can prevent your website from responding. Your end users wouldn't be interested at all.
  • Safety. Any website can come across DDoS attacks or similar. CDN can solve this problem quite easily.

Last but not least, any successful business experience growth that leads to traffic growth to the website and increased audience attention. I would suggest looking into CDN at the beginning of building your website as it would be much easier to plan, choose a provider and implement it according to your business needs.

However, the easiest way to test the benefits of CDN would be to use SaaS CDN solutions where in the face of a subscription fee, the use of the service is guaranteed without having to implement the entire technological stack from scratch.

Precautions to be taken into consideration and let's dispel commonplaces

However, the use of CDNs and their popularity have created a rather significant cognitive bias in website owners, publishers, merchants and even many professionals such as developers, SEOs and even hosters.

The basic concept is that having activated a CDN or a CDN service automatically the site is fast and meets the requirements of Google and visitors.

To better understand this phenomenon and this erroneous belief, I want to offer you a real case of one of our former customers who decided to change Hosting provider and activate a CDN like CloudFlare.

Site migrated Pingdom comparison before after

In the first column on the left we see the values ​​obtained on our Hosting without using any CDN, in the right column we see the values ​​obtained after switching to a common provider without having activated a CDN.

In the specific case we talked about it in this article, WordPress hostings are not all the same just keep in mind that after the passage the site has become 4 to 8 times slower with all the consequent SEO and traffic consequences.

In short, to give an example, it is like saying that since we have fitted the new seat belts and have the new ceramic disc brakes, we can afford to go at 300 per hour in the town with the conviction of being safe. The reality is quite different and the facts are always clear for those who have the good sense to measure to decide, and intellectual honesty to admit in hindsight to have caught a crab.

A CDN can never replace a fast and well-equipped hosting with all the features worthy of a performance-oriented software stack. At best it will limit some problems of an inefficient software stack.

Moreover, it must also be said that a CDN at a professional level has flat or consumption costs that are far greater than those of entrusting your site to a company like ours that has always been performance-oriented.

For example, let's debunk some of the clichés about CDNs below.

1. CDNs have HTML Cache functionality and can replace caches such as Varnish.

The statement is likely correct and almost always true. A CDN with HTML Cache functionality can replace Varnish and function exactly the same way. In many cases a CDN of this type uses its own Varnish Cache or NGINX FastCGI Cache and therefore it is just a matter of having others (in this case the CDN provider) do something that we could have done ourselves on our server at a lower cost and with an extreme degree of customization and tuning.

Obviously this is true where a CDN also has the HTML Cache function and not only the Content Delivery function of static content. Many developers, system engineers and professionals, for example, are still convinced that CloudFlare in the Free plan has the function of HTML Cache when this is absolutely not true and it is one of the reasons why that former customer we mentioned above in the screenshot before / after changing supplier he plans to solve some tuning and speed problems using a CDN like Cloudflare which doesn't offer an HTML cache by default.

2. CDNs allow you to save significant traffic costs.

Here, too, the statement makes sense based on specific cases and taking this statement as true could lead to an increase in costs even in the order of tens of thousands of euros per month.

The reasoning to be done would be specific case by case, situation by situation, but as a common rule it is worth thinking in order to evaluate and weight the cost of traffic on the source node and the cost of outgoing traffic from the CDN, taking into consideration the cost of plans that may be Flat compared to the costs of pay-per-use or consumption plans, and also evaluating the costs of the various suppliers.

For example, having a CDN like CloudFront's Amazon AWS ahead of a dedicated server on Hetzner it would make practical sense next to nothing, if not to have disproportionate costs, considering (account of the servant to follow) that 50TB per month out to Europe on Amazon's CloudFront would cost at least 4000 euros per month.

CDN Cost Example

Even bringing into play the other main competitors that you can see in the image above, the difference is really minimal, and you still get around the same at the same time considering that being enterprise-class competitors they also have rather similar price lists and prices.

However, the same 50TB output on Hetzner are included FREE OF CHARGE on all dedicated server plans that have an indicated range between € 40 and € 200 per month based on the hardware characteristics of the dedicated server.

Thinking with a view to saving instead, on CloudFlare, outbound traffic is included for free both in the Free, Pro and Business plans and therefore if we were thinking in terms of CDN for static content, it would make sense in terms of cost savings to use Cloudflare as a CDN for AWS instances such as Elastic Cloud for example.

For CDNs with pay-as-you-go plans such as AKAMAI, QUIC.Cloud, CloudFront, and the like, the rule of doing the calculations very, very well is always valid., considering that a site with a lot of traffic and many requests is enough for the graphic to load a high-resolution image by mistake, imagine a classic 4000 x 3000 in non-optimized PNG format, to increase your monthly bill by over 3000 euros (we refer to a case experienced by one of our clients).

3. CDNs improve PageSpeed ​​score and site speed.

Here, too, the discussion is very generic and much needs to be evaluated based on the type of CDN used and the functions enabled. Rarely, the functions offered by a CDN cannot be replicated on the server side with the right configuration on the server and application side. Think for example of the conditional serving of webp images, there are those who activate a CDN specifically to fulfill this functionality, as it would take 6 configuration lines written ad hoc in the configuration file of the virtual host in NGINX o Apache and a plugin for the generation of the respective webp such as, for example, webp express for WordPress.

Often CDNs are only half measures adopted by incompetent technical figures who do not know how to carry out their job correctly and prefer to delegate to third-party solutions those that other competent figures would be able to implement in 30 minutes of work.

Always remembering that perfect results can be achieved without the help of third-party CDNs if you have the expertise to know what you are really doing.

PageSpeed ​​Insight Crux Passed

Even when working with non-trivial CMS such as Prestashop or Magento, or even with custom systems for which there is no availability of pre-packaged solutions for the generation of webp images, a professional system engineer will find a way to manage this need independently, without resorting to to external technologies and SaaS CDN platforms, and at almost free costs.

4. CDNs should be used whenever you have a lot of international traffic.

This too is an urban legend without any foundation. The difference between a German visitor connecting from Germany to your Italian server compared to an Italian user connecting to the Italian server is practically nil.

Talking about a country and arguing that there are differences between a French, a German, a Belgian, a Spaniard, a Finnish, a Greek, a Swiss who accesses the same server in Italy, is just an exercise in theoretical style or an elegant business approach. to try to sell a CDN.

At best you will be able to get 10ms more or less of latency, which put into the total account could mean nothing, if for example you save 10ms of latency, but you insist on serving PNG images that are not optimized with the respective webp or you do not enable BROTLI compression preferring the now obsolete and antiquated gzip compression (however better than nothing).

CDNs, on the other hand, make a lot of sense when dealing with intercontinental traffic. An American, a Brazilian, a Chinese or a Japanese who connect to our server in Italy will have very different values ​​and latencies from each other and in some cases certainly below the minimum value acceptable by Google or by the user experience of a any value.

In this case, evaluating a CDN is certainly a duty of every system engineer or developer who cares about the client's business and their professionalism.

Bottom line, when could you fail to use a CDN?

Each case is a case in itself as we have so far more you want highlighted. However, there are conditions that if met can prevent you from having to use a CDN that would be effectively useless.

It should always be considered that in any case a CDN is still a service that works between your site and your visitor, often using the reverse proxy function as in the diagram below.

 

While considering the extreme stability of these technologies and these Content Delivery Network platforms, it must always be borne in mind that even the most authoritative and adopted CDN Enterprise such as CloudFlare can suffer even significant downtime and take your site and your business offline. that it wouldn't have been offline if you hadn't installed a CDN with a real reason.

A Cloudflare outage broke large swathes of the internet - The Verge

Here, then, is a brief guide to which you should answer if you are undecided whether to adopt a CDN or not.

  1. Does your site use a static cache like Varnish or NGINX FastCGI Cache?
  2. Does your site have a TTFB of less than 200ms?
  3. Does your site use BROTLI compression for static resources like JS and CSS?
  4. Does your site use Webp or AVIF image delivery compared to classic JPG and PNG?
  5. Does your site have mainly continental traffic for over 90% of requests and visits? In this case, continental means European.
  6. Does your site not saturate the outgoing bandwidth (usually 1gbit / s in both Cloud and Server dedicated solutions)?

If you answered all these questions with a YES and you are sure you do not want additional costs in the order of at least € 200 / month, you could easily avoid using a CDN in order to deliver the content.

If you answered several NOs instead, we recommend that you first of all change Hosting provider (you are probably supplying yourself from companies with amateur management who do nothing but resell you some solutions with Plesk and cPanel) with our performance-oriented Hosting service and only subsequently evaluate the adoption of a CDN.

Do you have doubts? Don't know where to start? Contact us!

We have all the answers to your questions to help you make the right choice.

Chat with us

Chat directly with our presales support.

0256569681

Contact us by phone during office hours 9:30 - 19:30

Contact us online

Open a request directly in the contact area.

INFORMATION

Managed Server Srl is a leading Italian player in providing advanced GNU/Linux system solutions oriented towards high performance. With a low-cost and predictable subscription model, we ensure that our customers have access to advanced technologies in hosting, dedicated servers and cloud services. In addition to this, we offer systems consultancy on Linux systems and specialized maintenance in DBMS, IT Security, Cloud and much more. We stand out for our expertise in hosting leading Open Source CMS such as WordPress, WooCommerce, Drupal, Prestashop, Joomla, OpenCart and Magento, supported by a high-level support and consultancy service suitable for Public Administration, SMEs and any size.

Red Hat, Inc. owns the rights to Red Hat®, RHEL®, RedHat Linux®, and CentOS®; AlmaLinux™ is a trademark of AlmaLinux OS Foundation; Rocky Linux® is a registered trademark of the Rocky Linux Foundation; SUSE® is a registered trademark of SUSE LLC; Canonical Ltd. owns the rights to Ubuntu®; Software in the Public Interest, Inc. holds the rights to Debian®; Linus Torvalds owns the rights to Linux®; FreeBSD® is a registered trademark of The FreeBSD Foundation; NetBSD® is a registered trademark of The NetBSD Foundation; OpenBSD® is a registered trademark of Theo de Raadt. Oracle Corporation owns the rights to Oracle®, MySQL®, and MyRocks®; Percona® is a registered trademark of Percona LLC; MariaDB® is a registered trademark of MariaDB Corporation Ab; REDIS® is a registered trademark of Redis Labs Ltd. F5 Networks, Inc. owns the rights to NGINX® and NGINX Plus®; Varnish® is a registered trademark of Varnish Software AB. Adobe Inc. holds the rights to Magento®; PrestaShop® is a registered trademark of PrestaShop SA; OpenCart® is a registered trademark of OpenCart Limited. Automattic Inc. owns the rights to WordPress®, WooCommerce®, and JetPack®; Open Source Matters, Inc. owns the rights to Joomla®; Dries Buytaert holds the rights to Drupal®. Amazon Web Services, Inc. holds the rights to AWS®; Google LLC holds the rights to Google Cloud™ and Chrome™; Facebook, Inc. owns the rights to Facebook®; Microsoft Corporation holds the rights to Microsoft®, Azure®, and Internet Explorer®; Mozilla Foundation owns the rights to Firefox®. Apache® is a registered trademark of The Apache Software Foundation; PHP® is a registered trademark of the PHP Group. CloudFlare® is a registered trademark of Cloudflare, Inc.; NETSCOUT® is a registered trademark of NETSCOUT Systems Inc.; ElasticSearch®, LogStash®, and Kibana® are registered trademarks of Elastic NV This site is not affiliated, sponsored, or otherwise associated with any of the entities mentioned above and does not represent any of these entities in any way. All rights to the brands and product names mentioned are the property of their respective copyright holders. Any other trademarks mentioned belong to their registrants. MANAGED SERVER® is a registered trademark at European level by MANAGED SERVER SRL Via Enzo Ferrari, 9 62012 Civitanova Marche (MC) Italy.

JUST A MOMENT !

Would you like to see how your WooCommerce runs on our systems without having to migrate anything? 

Enter the address of your WooCommerce site and you will get a navigable demonstration, without having to do absolutely anything and completely free.

No thanks, my customers prefer the slow site.
Back to top