/ optimization

What is CDN and why you need it to speed up your website in 2018?

Does the slow website download speed make you nervous? Most users don’t like it. We thought that this problem went down with the phone modems, Windows 2000 and the first iPhones, but no. Today, we continue to waste our nerves, waiting for the pages to load, but today it affects the site owners: they lose visitors and money.

How performance problems affect the website revenue and user experience

Nowadays it’s very easy to make a beautiful design and convenient website interface. But it’s not important if the site loading time is too long. Users are becoming more and more impatient, and according to the research, 47% of customers expect that loading the page will not take more than 2 seconds. The percentage is even higher when we talk about the mobile users. 64% of smartphone owners are sure that 4 seconds are enough to load the page. If your site doesn't meet these requirements, it negatively affects both the loyalty of users and their behavior.

For example, the download delay of only 1 second, reduce the number of page views by 11%, and the conversion by 7%. According to Akamai and Gomez.com research published on Kissmetrics blog, 40% of users leave the site if the download speed exceeds 3 seconds. It is logical that 4 out of 5 site users (79%) will no longer make purchases on it if they are dissatisfied with its effectiveness. Well, is not this a reason to improve the website optimization and performance?

The online commerce giants understood that the website speed is one of the main factors. For example, since 2010 Google forms the search results page giving the priority to the resources with faster loading. As a result, the owner of a slow site can lose lots of money. Amazon, for example, calculated that 1 second slower loading causes $1.6 billion loss per year.

Indeed, the IT giants practically demonstrate that loading speed is one of the most important factors in online business profitability. Milliseconds can change everything: you can either lose billions or increase your profits. As an example, when your site brings $100,000 a day, then improving its boot characteristics can bring you an additional $7,000!

According to infographics on Social Media Marketo, raising the search ranking to at least 2 positions to an increase of organic traffic by 20% and the number of views by 14%. According to Yahoo, improving the page loading time by 0.4 seconds can increase traffic by 5-9%. The Edmunds.com car site reduced their pages download time by 7 seconds, and it increased the number of views by 17%, and advertising revenue grew by 3%.

AutoAnything (the US leader of the online market of spare car parts) found out that the double loading speed acceleration increases the conversion by 9%, and sales by 13%. Shopzilla improved the loading time by 5 seconds that raised the number of views by 25%, and the conversion by 7-12%. Walmart reduced the downloading speed from 14 to 7.8 seconds, the interaction time from 7.2 to 2.9 seconds, which improved the search results by 44 positions!

The average page loading time of the online store is 3.5 to 4 seconds. So, if your site is not specific, the low speed will cause the low positions in search results, low conversion, and weak sales.

There are a lot of tools available to improve the website performance. One of them is using the CDN — Content Delivery Network or Content Distribution Network. Let’s look closer what is CDN, how it works, how it improves performance and how it helps SEO of your website.

What is CDN

CDN is an abbreviation of the content delivery network. Mostly, this is a set of servers with specialized software that accelerate the content delivery to the end user. Servers are located around the world, so the site response time is minimal. Under the content, we mean videos, audios, images and static elements of websites that do not require the code execution on the server or the database requests, for example, CSS or JavaScript. Sometimes it can be the Steam games (the platform uses CDN to distribute files), operating system updates, etc.
What is CDN and how it improves the performance

How it works and improves the performance.

All modern CDNs place copies of content on different servers around the world and direct the user to the nearest server. The result is a latency reduction or the delay between request and response. If there are a lot of images on the page (even small pictures), then the faster the user gets them, the faster the user will see the page. The time the page will be displayed is determined only by the network delay. If we talk about distances of hundreds of kilometers (~ 10ms delay), this is not essential. But if we are talking about distances between continents, then a delay of hundreds of milliseconds (up to 500-600) plays a radical role. And if the content is given from a server that is several kilometers from the user, then the users will get the content in several milliseconds.

Let’s see some practical example. The user visits the site example.com, and his browser gets a static HTML-page. The HTML-page signals the browser that all CSS, JS, pictures, and videos are stored on cdn.example.com, so the browser loads the content from there. When the browser accesses the server, it redirects the client to the closest CDN point. As a result, the request travels the shortest distance.
As most of the static content changes quite rarely, getting the cached files from the CDN servers improves the page rendering. In this case, the network latency will be much shorter than when the user will access the home server from a remote area. The request will not have to travel to the opposite side of the Earth.

How CDN helps SEO: good practices

There are a lot of thoughts how a CDN affects the SEO of your website. Some people believe that it hurts the SEO, but actually, it helps in many aspects. Let’s see what they are.

Site loading speed is one of the key factors

Actually, the loading time influences everything: visitors satisfaction, user experience, bounce rate, dwell time and conversion rates. as mentioned earlier, back in 2010 Google announced that site loading time is an important ranking factor. Especially, when more than half of users use their mobile devices to access the website.

Attention! Get rid of render-blocking scripts
Never forget that CDN is not a magic stick and cannot boost your site when other SEO factors are used improperly. CDN works right the same way you configure the server or front-end. When your page is full of render-blocking elements, your loading will yet delay. What are these elements? They are JavaScript and CSS files which block the rendering until the browser loads the page. Here are some tips that will help to fix the possible issue.
JavaScript:

  • Inline it if it is small. Just insert the code into HTML document within <script>...</script> tag.
  • Use HTML async attribute while adding the JS code.
  • Defer the JavaScript.
  • Move the code to the footer section (not always effective).
    Read more on Google Developers.

CSS:

  • Minify the CSS files by getting rid of additional symbols, spaces or comments.
  • Try to use fewer CSS.
  • Give the CSS files proper names.
  • Reduce the number of CSS files.
  • Use media queries to identify some files as not render-blocking.
    Read more on Google Developers.

Secure HTTPS is an important ranking factor

You can use HTTPS protocol to connect to CDN while using regular HTTP on your main server. After the recent release of HTTP/2, the HTTPS performance was highly improved. Now it includes server push, one connection per origin, HPACK compression, and multiplexing. It means that now HTTPS is really fast.
When you have Let’s Encrypt integration, you can enable HTTPS without any payments. And if your CDN provider supports HTTP/2, you will notice the loading speed improvement.

Faster indexing on search engine result pages

If we say in a few words, a CDN service can improve images indexing on search engine results page. People often look for something in Google Images. In a case your images are stored on CDN, it really helps to generate more traffic to the website. According to a research by Brafton Marketing, 63% clicks on images, found on Google Images, transform into a site traffic and new visitors. But we must admit that it can vary depending on the niche of your resource.

When you decide to store the images on CDN, they will be indexed by Google crawlers much faster and more often. So, you will definitely see how the position of the website on search engine result pages significantly improve.
Another option is using a CNAME for the CDN link. Mostly, any CDN service provides their users several ways to get the URL:

  • automatic one — the company gives you a random address you cannot change; mostly it is generated automatically;
  • custom one — you are able to use the CDN link with your own domain. For example, it may look like cdn.example.com.

The second option — a custom CDN link — is preferable for a number of reasons:

  • With custom CDN link, you can check how Google indexes your images in Google Search Console. It is impossible with default random addresses. So, think about using a custom link. Many services provide the feature for additional payment.
  • Once you get a regular CDN link, you can use it on any other service. It will also allow you to change the CDN provider without the SEO breakage.
  • A custom CDN link improves your branding, as the link contains the address of your main site. Google will rank it better when the domain is associated with the root server.

Attention! Correct the image indexing problem while using Yoast SEO on WordPress website
Quite often the WordPress websites have an error of de-indexing the images in Google Search Console. When you see the statistics of your site in search console, you will see how many images were submitted and indexed. When the number is not equal, do the following:

  • Use any code editor app like Visual Studio Code, Sublime Text or any other and open functions.php in the root folder of your WordPress website.
  • In the top of the file add the following code updating the CDN link:
    function wpseo_cdn_filter( $uri ) { return str_replace( 'https://www.example.com', 'https://cdn.example.com', $uri ); } add_filter( 'wpseo_xml_sitemap_img_src', 'wpseo_cdn_filter' );
    Attention! Please don’t forget to write your domain name instead of example.com.
  • Update the file and don’t forget to upload it to the server in order to apply changes.

Debunking popular CDN myths

Now let’s see some popular myths related to CDN and debunk them all.

CDN causes the content duplication

It absolutely incorrect! When you configure your CDN network correctly, it will never lead to any duplicated content. How to avoid the possible problem?

  • Use canonical header. This is an additional HTTP header you have to add to the CDN. It will tell Google crawler that the content stored on CDN is not the duplicate but just a copy. As a result, Google crawler will not index the images twice and it will not influence your search results page position. Most CDN services provide the feature by default. Read the great guide about canonical headers on Yoast blog.
  • Use correctly configured robots.txt file. Robots.txt file tells search engines how to index your website and which folders to avoid. In a case you don’t use the file, the crawler will scan everything. Most CDN providers will never allow that as canonical header works, but we advise to ensure that everything is okay.

Attention! Keep a similar file structure.
In order to avoid incorrect images indexing by Google, try to keep the same file structure when you decide using a CDN. Let’s see some examples.
Let’s think that an image is available on www.example.com/wp-content/uploads/2018/02/image1.png. How should you change it? It must be cdn.example.com/wp-content/uploads/2018/02/image1.png. Along with canonical header, the correct file structure will help to keep all the traffic in image search by Google or any other search engine.

CDN is very expensive

No doubt, you will have to pay for your comfort. Most providers charge for each gigabyte of traffic or the bandwidth. If your site is not very loaded, your plan can start from $0.04 per GB. It is really not much! An average monthly budget can be about several dollars. Anyways it depends on an amount of traffic you need.

CDN is difficult to use

We don’t deny that it can be quite difficult especially when you are a newbie. You will have to learn something before using. However, there are a lot of available resources to get help in installing and configuring a CDN. Many providers even offer the official plugins for popular CMS like WordPress, Drupal, Joomla, Magento, Ruby, and Laravel. The tech support is always ready to help you with any question. Just try and you will see that it is not very difficult.

The benefits of using the CDN

To conclude all the information, let’s highlight some benefits of using a CDN.

  1. A faster site gets the higher conversion and more page views.
    The longer the page load time, the more likely that impatient visitors will not wait and leave the site and not return again. In the beginning, we provided some statistics how the load time affects the number of visitors who can potentially become your customers.
  2. A faster site gets higher positions in search engines.
    Each search engine keeps the search algorithms and ranking formulas a secret. However, it is absolutely obvious that search engines crawlers will not include the page in the search index if the load time is too long. In addition, behavioral factors have an increasing importance. It means that the visitor who left the slow page will automatically reduce its position on search result page. Finally, almost all popular search engines representatives say that the ranking formulas directly give weight to the page loading speed.
  3. The slow site brings direct financial losses during advertising campaigns.
    You want to actively promote your project. You order contextual and banner advertising. Each click costs money. If a visitor entered the site through the ads but did not wait until the page loads, then you just paid for nothing.
  4. Connecting a CDN reduces the main site servers loading.
    Since all static content is downloaded by the site visitors not directly from your servers, but from CDN nodes that can efficiently cache a content, the number of requests to your server significantly reduces. Averagely, for static content, the ratio of the number of requests to the site from the CDN servers to the number of requests from live site visitors is about 1:50.

How will it help you if your site is not very big or due to the limited budget you use cheap hosting or shared server? Most hosting providers have a lot of limitations in cheap plans. Using a CDN, you can circumvent those restrictions. Let’s know more.

  • Limited bandwidth and traffic. When the popularity of your site grows, the more visitors you get, the more traffic you use. When the paid traffic expires, your site is unavailable. With the help of CDN, you limit the traffic usage directly from your server as graphic content is taken from the CDN.
  • Limited storage. The cheaper plan you use, the less disk space you get. Obviously, when you store the pictures or videos on your server, you will exhaust the storage very fast. Holding them on CDN will let you save your server free space.
  • Limited amount of simultaneous connections. When all your static files are stored on home server, the browser requests it directly. If many users try to access the site simultaneously, someone will not be able to enter it, and you will use your customers. Having installed and configured a CDN, you will make your server’s life easier.

We hope that this material helped you to understand what is CDN and how it works. When you just try it, you will see that it’s not very expensive or difficult, and highly improves your website SEO.