Within the webmaster community there are a always lots of myth floating around the internet. So when a non-technical person is thinking about starting his new business-website or blog, he reads these myths and hopes that it will makes his site lightning fast. But the reality is way different than what it seems. Almost all the CDN (Content Delivery Network) companies make you believe that adding their CDN service on your website will instantly supercharge your website and make it load at a lightning fast speed. But you see, this claim is not entirely true. In fact, there are many scenarios where it is wiser to not opt for CDN and invest that money in some other part of your business.

So, despite the magical believe in CDN amongst most people, today I will share 4 situations in which you should concentrate on the other part of your business/website rather than paying for CDN. This will help you understand whether or not you need CDN for your site. At the end I will also share a speed test result with and without CDN enabled, so that you guys can get a clearer picture. But to explain the situations first you need to understand that CDN is not a magical service to make your site instantly fast. Now you need to understand what a CDN is and how it helps.

So, what is a CDN?

CDN stands for Content Delivery Network. In short, it is a deep network of super powerful servers located at various parts of the world, that wil send you the static content from your website from the nearest server with the lowest possible latency. Generally, if you have a normal web hosting (let’s say the server is located at Chicago, US), all of your website’s files are stored on that server. Now when someone requests for a page of that website, the server has to send all the static resource files (like image, css, js files), while also having to execute all of your dynamic programming (like PHP), to generate a normal static HTML file. After this, the server sends all those files to the client who requested for them. Let’s take a look at this basic diagram to understand it easily.

General Server Response

General Server Response

Now, when the CDN comes into the story the entire process gets changed. So, when a user first visits a CDN enabled site, the files get delivered from the actual host server, so the site might load at its normal speed. After a few hits from the similar region, the nearest CDN server stores all the static files (like image, css, js etc.) to that superfast CDN node. Now from this point on all those static files will get delivered directly from the CDN server (which is physically much closer to you), reducing the latency and the nodes are very fast too. Here is a quick diagram about how a CDN enabled website works.

Server Response with CDN

Server Response with CDN

So, now as you can see having a CDN on your site will help visitors who are farther from your actual server location to receive the static files from a CDN node closest to their location at a low latency and high speed. Also it will reduce a bit of load on your actual server too, since most of your static files will get cached by CDN servers all around the world. But the dynamic contents will still be provided by your actual servers only.

Most people have a misconception that CDN servers are only able to cache and deliver static contents, but that is not true. CDN servers are just like any other normal server but both the hardware and software of those servers are extremely optimized to make sure they deliver a lightning fast performance. So, just like any normal server CDN servers can cache dynamic contents too, but it is extremely complicated to implement and sometimes doesn’t work well with various plugins or CMSs. That is why most people only use CDN for delivering their static files all around the world at a super-fast speed.


So, now as we have discussed about what is CDN and how does it work, it is now time to discuss about the situations where having CDN on your site will not make much difference from the perspective of your user’s experience.

CDN doesn’t help much to Local Audience targeted sites

There are basically two types of website lives on the internet. One with a global audience target and the other with a local audience target. For example: Blogs generally target a global audience, as people from around the world may be interested in the same content. On the other hand, there are many business sites and blogs which targets to a specific region or country. The website of a local optometrist will only be relevant for people from the same city or province or at maximum people from the same country. Generally, a person from Australia will not book an appointment for an optometrist located in Canada.

There are also many blogs that right about a specific region or may be a school soccer team. There can be many business websites too who targets only a specific region (within a country) and not the entire world. For this kind of sites CDN is nothing but a waste of money.

Let’s say the server you have for the optometrist site is located at Chicago and people from New York visit it the most. You might think, if I get a CDN for my site, the static files will gets delivered from the CDN node at New York and the files need not to travel from Chicago to New York every time. But in reality, the fraction of second that will be saved by doing this is completely unnoticeable and you will end up paying for something you will not need.

CDN will not help much for slow web hosting

As I said above, CDN mostly handle your static files, but the dynamic contents (generated by PHP) is still being handled by your server itself. So, unless your server quickly executes the dynamic files and sends the generated HTML to the browser, CDN enabled static files have to wait for the HTML to arrive. This will eventually create a slow user experience instead of baking your website lightning fast. So, I highly recommend you to get a good hosting first, like what Bigscoots or Siteground provides, before thinking about CDN.

CDN will not help for sites with less static content

Generally, if your site doesn’t have much static contents (css, js, images etc.) in it and most of the stuff is generated dynamically, then CDN won’t be much help to you for speeding up your site. As most of the data of your site needs to be generated by your actual server before sending out to the user, I think it is wiser to concentrate on a highly optimized faster server, rather than on CDN.

CDN doesn’t help for badly programmed websites

As I stated above, CDN is a content delivery network. It makes sure the static content of your site is received by the client faster. That’s all. CDN has nothing to do with making your website rendering faster. One of the major problem with fancy websites is that they have been programmed very badly. Especially in the javascript (jQuery is part of javascript family) and css department. You see no matter how fast the static contents of your site gets loaded, if you have javascript or css directives that blocks rendering, then you are going to have a relatively slow user experience.

Try to use as little JavaScript as possible in your website. Do not use any JavaScript triggered element above the fold, if you can help it. The less javascript objects you use, the faster your site will load in terms of rendering. Always load all (or as much as possible) of your javascript files at the end of the HTML, just before the closing <body /> tag.

The same principal goes to CSS. Use as little css files as possible and stay away from the css @import directive. I know these are very hard rules to follow in CMS like WordPress, as css and js files get included all the time by various plugins along with themes. This is one of the major problem with multipurpose themes on various theme store like themeforest. These themes come with tons of different features which might be useless to most people, but unfortunately they don’t program their theme to include certain css or js files only when they are needed.


Beside all these situations, if you have a website which targeted towards a global audience and also runs on a fast hosting environment, I will highly recommend you to try out CDN for your site. As it will reduce the load time of your site for the people who live far away from your server’s physical location.

How much speed can be increased with CDN? Is it really beneficial to you?

If your website does not fall under the above 4 situations, CDN can really reduce your website’s pageload time, giving the a faster user-experience. Here is the load test comparison result (with and without CDN) for one of my client’s site. Before you look at the site load time result, here are a few things you need to consider:

  • The site has been hosted on a super fast highly optimized SSD server located at Chicago, USA.
  • The site uses many heavy (resource hogging) plugins like woocommerce, bbpress, buddypress etc.
  • The site is highly dependent of JavaScript and jQuery scripts which blocks rendering. So, the overall render completing time is a big number.
  • The CDN that has been used for the testing is KeyCDN (a review is coming soon).

So, let’s look at the load test result now:

Test LocationWithout CDN Load TimeWith CDN Load TimeTime Difference
New York, USA3.62 sec2.91 sec710 ms
Dallas, TX, USA3.75 sec2.90 sec850 ms
Melbourne, AU10.30 sec5.80 sec4.5 sec
San Jose, USA3.87 sec3.24 sec630 ms
Stockholm, Sweden5.85 sec3.97 sec1.88 sec
* all the load test has been done using Pingdom Tools.

So, as you can see, the locations within USA itself don’t have much load difference as the actual server is in the USA itself, but when I started testing locations far away from USA, the load time difference can be clearly seen and this is where CDN excels the most. So, unless you have global audience need, I don’t think you will get much benefit from using CDN.

Conclusion

CDN is not for every website out there. If you do not have a high amount of daily global audience, the money you will be paying for a quality paid CDN service, will not yield much benefit for you or your business. Also even if you have a good global audience, make sure you have hosted your site with good hosts like Bigscoots or Siteground so that the server is capable enough to send the dynamic files super-fast to the client. In the end to make sure you receive the best possible outcome with CDN, ensure that your website is fully optimized.

Feedback

Do you guys use CDN? If yes which CDN provider you prefer most and why? Also do you agree with the 4 situations I’ve mentioned above? I would love to hear your thoughts on this and continue this conversation in the comment section below. Feel free to share your thoughts.

You can also connect with me via twitter @iSaumya. If you like this post, please don’t forget to share it with others who might enjoy reading it. Also if you have any other ideas or request about future posts, you can let me know in the comment section below or via twitter.

Published by Saumya Majumder

Passionate, Hard Worker. Love to develop new things, Singing Songs, playing computer Action Games, tweaking with computer languages, Riding Bikes, Love long driving, love books, web & Photography. You can follow me on twitter @iSaumya

10 Comments

  1. Hi Saumya, thanks for this post. I agree mostly, but will add the scenario in which a website targets a regional audience but the webserver is located far away. In that case a CDN might still be useful, although it might be even better to find a good provider with servers nearby the target-area.

    In our case we have a server in USA, while the target-audience is located in Europe (specific The Netherlands and Belgium). A CDN will then still reduce pageload time. In our case it using KeyCDN reduced pageload with about 2 seconds in several European countries, but for some reason Frankfurt still had enormous loadtimes. It seems most nodes of KeyCDN seem aimed at America, some are in Europe, and the least are in Asia or nearby Australia. One should therefore test and know what CDN is active in what region, to know what to expect in any specific user case.

    Also it depends on how your business acquires customers and what role the website has in the business. If the acquisition is mainly based on physical meeting and word of mouth and the services are also based on meetings, then the role of the website is different then when a business is dependent on internet marketing for acquisition and has a downloadable or other virtual product. In the end business needs are leading, not technical qualities. If more speed doesn’t translate in more customers or more sales, than it has little value for that specific business. So it depends and in some cases the cost may not outway the benefits, even though there are benefits

    Thanks for the insights.

    Hans

    Reply
    • Hi there, first of all if you have a country specific targeted audience, then it is better to get quality hosting on the same or nearby country. Coming to the KeyCDN, KeyCDN has the highest number of nodes at the most affordable price. Almost all CDN companies has the highest number of nodes in USA then Europe and at last Asia. Considering that, KeyCDN has really good amount of nodes. If you have a internet based business where your website is actually a part of your business (not just a showoff), maybe you take online orders or book reservations or anything like that; a faster website will always yield better customer experience and hence more happy user in long run. If a new customer comes to your site and it takes ages to load, he/she has already lost the interest in your work. So, even if it loads the chances of converting that visitor is very low. So, a faster website is always beneficial, unless your website is nothing but a show off and you run a physical business which matters the most.

      Reply
      • I agree. A faster website gives a better experience and if it is beneficial to the business it will be logical to invest in that. In the extremes the choices are clear, but most choices are not between the extremes. In the end it is a balance to optimizing customer experience and customer-value versus costs and incomes. It’s just one of the business decisions.

        We have chosen for good hosting but had not taken into account where the servers where physically located. I hadn’t considered that it would take more than two seconds for files to travel from USA to Holland.

        The previous host had servers in Europe, Italy, but we were not that satisfied there. Now we have more speed and knowledge, even though we lose some seconds by having pages send from USA to Europe. It’s a learning process.

        Reply
        • Yes, You are absolutely right it is a business decision based on income. But considering the low amount KeyCDN charge, I really don’t think it makes a big hole in the overall income (my personal opinion). You see it doesn’t take 2 seconds to travel files from USA to Europe. In fact it takes a few milliseconds. But in case of your site (already explained above) there are too many javascript and jquery dependencies inside your theme which blocks rendering of the overall site making the end result slower. To test this theory, create a normal html page and put 10 – 20 image there. Now open the page on those locations where you are getting the slowest speed, you will see how much faster it gets loaded.

          Reply
  2. you didn’t mention anything about how cdn can prevent ddos attacks!

    and how it can serve cache even when the original server is down

    also cloudflare has most features free for one domain which most of the bloggers have

    and also cloudflare ssl certificates etc.. not as good as letsencrypt! but worth mentioning

    this post looks like dis-favoring cdn and IMHO it is biased!

    Reply
    • Hi there,
      I have tested cloudflare many times and personally not a fan on it. I’ve seen it making site slower (instead of faster) many times. The only quality thing that cloudflare provides is their free dns which is the fastest free DNS. Also as you mentioned about serving cache though cdn when the actual server is down, this is something cloudflare provides as it runs as an layer over your actual site but not any other CDN, unless you are hosting your site over CDN only. So, in normal cases for normal CDN, when your actual server is down, your static files can still be accessed via CDN, but it will not help you as the HTML will not generate unless your actual server goes up.

      Also I’ve seen many times that when cloudflare shows a cache version of s site (at the time of server down), it barely works properly and clicking on any hyperlink will show you an error page. So, what’s the point?

      Also I never discouraged using CDN, I’ve showed a few scenarios where using CDN will not be a Good option and you should consider on your actual server or website before thinking about CDN. Besides those scenarios CDN will almost always help you to speed up your site globally. I’m not sure why you said it is biased? Is it because I’ve mentioned KeyCDN? The reason I used KeyCDN is because it is the most affordable quality CDN provider with many nodes around the world. And about using cloudflare, I still stick with what I said earlier. Besides their DNS service, rest are really not that good. You can check this in-depth article if you wanna dig more about cloudflare.

      Also about cdn preventing DDOS attacks: This is another thing which I think you got the idea from cloudflare. CDN never protect your site from DDOS attacks. CDN has their own physical server just like you have for your site. So, when DDOS attacks happens on your site, it is your responsibility (in case of unmanaged hosting) or your hosting company’s responsibility (in case of managed hosting) to prevent it. Also if there is any DDOS attacks happens on the CDN server, the CDN company will work on it. I will highly suggest you to take a look into the above CDN request-response diagram to get a basic understanding about how CDN works. Cloudflare is a bunch of things packed into one thing, that is why most of the things it does is not quality thing. It is not a proper CDN. Cloudflare provides free CDN which is a part of it.

      BTW, I never write any biased article no matter what the topic is.

      Reply
      • a cdn can prevent http based DDOS!

        you didn’t mention about free ssl I talked above!

        I was my opinion that this article looks like discouraging cdn

        also care to comment on why did you again shifted to disqus.com I also noticed the change only in few blog posts not all the blog posts!

        Reply
        • KeyCDN provides free SSL too via either shared ssl or via letsencrypt. Also as I said CDN has nothing to do with DDOS attacks as I explained previously. Also I didn’t discouraged people to use cdn. I just simply shared a few scenarios where cdn is not your no. 1 priority.

          Regarding the disqus this, a new article is coming about which I switched to disqus. So stay tuned for that.

          Reply
          • https://blog.cloudflare.com/ddos-prevention-protecting-the-origin/

            https://www.isaumya.com/7-reasons-to-avoid-disqus-commenting-system/
            now I am waiting for 7 reasons to use disqus 😛

            bcoz of disqus I lost one comment in old commenting system and had to type the comment again!

          • As I said above, cloudflare is not a proper CDN service. First understand this. Cloudflare is a bunch of services packed into one name like DNS service, CDN service, minification service, lazy load service, IP detection service etc. A proper cdn service providers are like maxcdn, keycdn, akamai, cdn77 etc. Also as I’ve stated earlier, I used KeyCDN for my tests is because it is the cheapest and provides a lot node locations than others. The reason cloudflare provides somewhat ddos protection is because it run as a layer over your site (that is why you need to change your nameservers).

            But personally I’ve tried to use cloudflare’s service many time and it wasn’t that good (except their awesome free dns which I still use). It made my site slower rather than making faster also not to mention breaking up some fancy design and features. So, I personally don’t use it and don’t recommend anyone to use either.

            So, just because cloudflare provides DDOS protection doesn’t conclude that CDN provides DDOS protection. As I stated earlier:

            CDN never protect your site from DDOS attacks. CDN has their own physical server just like you have for your site. So, when DDOS attacks happens on your site, it is your responsibility (in case of unmanaged hosting) or your hosting company’s responsibility (in case of managed hosting) to prevent it. Also if there is any DDOS attacks happens on the CDN server, the CDN company will work on it. I will highly suggest you to take a look into the above CDN request-response diagram to get a basic understanding about how CDN works. Cloudflare is a bunch of things packed into one thing, that is why most of the things it does is not quality thing. It is not a proper CDN. Cloudflare provides free CDN which is a part of it.

            Now regarding the disqus thing, it won’t be a 7 reason to use disqus, it will be more like why I moved to disqus from default wordpress comments. Stay tuned for that article. I’m really sorry for the problem you faced with your last comment. As I’ve implemented the disqus thing just a few hours back it is propagating everywhere and soon you won’t see any more issues like this beside a seamless comment experience.

            Hope this helps.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Subscribe To My Newsletter

Subscribe To My Newsletter

Join my mailing list to get meaningful content, useful information, how-tos, tricks, tips for webmaster, bloggers and entrepreneurs to rise and profit in your online business.

You are almost there! Just check your Inbox to confirm the Subscription & you are all set.

Shares

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close