I’ve been asked this question four times this week by different clients. So I wanted to respond and post an answer here as well. Most of our clients who are concerned with site speed are usually Magento merchants who want fast sites. But this also works for a normal WordPress site as well.
The Question: How does a CDN (Content Delivery Network) help increase Website speed?
Answer: Four different ways (see below).
As background, a CDN works by taking all of your images, CSS and javascript, and saving a copy of these files onto their servers that are dispersed around the globe.
So when someone visits your site, your logo, for example, is served from a CDN server in their geographic area. Someone from New York, for example, will download your logo from a server in the New York area.
This does four things:
- The speed and time it takes to download the file is much quicker. Instead of having to go to a datacenter in Michigan and traverse across the US, the image is served from a local data center in New York. We’re dealing with speed of light issues (how long it takes for light to travel from New York to Michigan) as well as how many different server hops and network jumps it could take. In some cases, the path to download a single image could take 30 hops across the public Internet. With a CDN, this can drop to 4-5 hops.
- Images on a CDN are often server in a GZIP / slightly compressed format for most Web browsers. What this means is that CDNs are configured to use a type of ZIP compression on images, so that when it is transmitted over the public Internet, the actual file size is slightly smaller (20% – 30%). When the end user’s browser downloads the image, it then re-inflates it. Most images contain pixels that have similar color information. An image of a night sky and moon has a lot of black in it; this is something that can be compressed down by 90% from the original RAW image file.
- Third, having images served from a different location can allow a browser to work more quickly. Most browsers will limit how many images or resources it downloads at a single time from a single site. So if you have 25 images on your site, your browser may only download 10 at a time before then trying to download the next 10, etc. By having a different domain location for downloading images, you can have multiple threads run concurrently on your site.
- Third, because images are not being served from your Web server, this places less of a load on your Web server to serve the HTML code, images and everything else. This speeds up the process, and allows your web server to handle many more requests, without having to also send out images, too.
Google does use site speed as a key ranking mechanism. People who visit sites that load more quickly tend to think that the sites are better, and they visit more pages, and spend more money. Google knows this and will reward sites that load more quickly with higher rankings.
Is a CDN a magic bullet? Nope. If you have a lot of complicated database calls on your site that take a lot of processing and mySQL overhead to produce, then your site is still going to be slow. (That’s where full page caching can help.)
If you have a slow server that can’t handle lots of requests (perhaps you’re hosted on a shared server), then a CDN is just one small part of the piece. Upgrading to a faster server will probably be a better way to go… at least for now.
I’m pretty obsessed about site speed. If you’d like to know more – call us: 303.473.4400 or visit here to have someone from our team contact you now >>