What is a CDN (content delivery network)?
Some of web developers are even not familiar with the concept of CDN. This is a system of edge servers (also called PoPs, or points of presence) that are scattered strategically around the world. Edge servers store and cache copies of your website’s static assets (JavaScript, images, HTML). When a visitor opens your website, its assets are served from PoPs located as close to them as possible.How does a CDN Work?
Say, you host your website in a data-center in New York. When someone from Europe visits your website, they will have to download your entire pages from the States. That will cause latency because of the distance the data has to travel. With a content delivery networks, a request is made for the initial HTML doc, but all page static assets are served from the closest PoP, for instance, in Amsterdam. A CDN can greatly decrease latency and minimize the risk of packet loss, which improves the quality of content delivery.How does a CDN improve your SEO?
There are many misbelieves concerning CDN and how it affects your SEO, and we will discuss those in the post. But first we should understand how CDN is connected with SEO value.- Speed is #1 ranking factor
- If your JS is small, you can inline it.
- Load the scripts asynchronously with the help of HTML async attribute.
- Defer your JavaScript.
- Move JS to the footer (however, it’s not always the best option)
- Change methods to defer JavaScript
- Appropriately call your CSS files.
- Use media queries to mark some CSS resources as not render-blocking
- Decrease the number of CSS files unite your CSS files into one file, noting that this becomes less important with HTTP/2).
- Minify your CSS (get rid of extra spaces, characters, comments and so on).
- Use less CSS overall.
- HTTPS as the new golden standard
- Faster image indexing for SEO
- With a custom CDN URL, you can implement a sitemap to check indexed images data in Google Search Console. With the default zone URL, this data is not visible, though you can still use URL search operator.
- You have overall control over custom CDN URL, and can change CDN provider easier saving the same URLs.
- A custom CDN URL makes up for better branding, because visitors can see image URLs, and it’s easier for Google to associate the domain.
Debugging CDN myths
As we have mentioned before, there’s a bunch of misconceptions about CDNs suggesting that using this technique is bad. Let’s debug some of them.- A CDN causes content duplication
- Make sure you have a canonical header setup. It’s an extra HTTP header that’s added to CDN to inform Google crawler that the content on your CDN is just a copy. As soon as you add a HTTP header, images will start indexing normally, because crawler will be aware that these are copies and won’t replicate them. Most CDN providers have this feature, and it can be enable in one click.
- Don’t forget about robots.txt file, because search engines scan the root of your website by looking for it. If the file is revealed, they follow instructions, but if no file is present, they scan everything. By default, most CDN providers won't enable this, because everything is indexed. The canonical header truly helps. However, if it is enabled, make sure you allow everything to be crawled.
- A CDN is expensive
- A CDN is hard to implement