There are many factors into what makes a website load quickly. One of the big factors is the physical proximity of the server to visitor. Think of it this way; If my hosting server is in Northern Virginia (which it is) and a visitor to my site is located in London, that means that the file literally needs to travel more than 3,000 miles. While most of the internet is built on fiber optics that travel at the speed of light, there it still takes time to be sent to a web browser. This is commonly known as latency.
The other benefit of a CDN is it helps your website perform better under high traffic. If your website is getting a lot of visitors at once it is serving all of the files from a single source. As visitors request multiple files at once, the server can get bogged down trying to send files and end up slowing down. With a CDN, your files are distributed on dozens of not hundreds of servers across the globe that are specially built for serving files quickly.
KeyCDN is a popular CDN company from Switzerland. They have an easy to understand pay-as-you-go pricing model that makes it easy to get started. They have servers in 29 cities on every continent (except Antartica, of course) and are constantly adding more.
They have some really nice features that make it a top-tier choice:
- 100% SSD Based
- Free SSL Certificate via LetsEncrypt
- HTTP/2 Ready (for even faster speeds)
- Custom CNAME support (cdn.yourdomain.com)
- Push and Pull zones
KeyCDN’s pricing is very favorable compared to other services offering pay-as-you go pricing that’s good for a year, versus monthly pricing that other CDNs require.
Setting up with WordPress
KeyCDN is really easy to set up with WordPress. Once you sign up for an account, got to Zones > Add new and enter your website’s info and click “save”.
Optional: Set up a custom CNAME
If you want to use your own domain name, like static.protechig.com, you’ll need to set up a Zone Alias. First, get your CDN Zone URL from the Zones page:
Then make a CNAME record with your DNS host to point static.protechig.com to your Zone URL.
Then, click Zonealiases > Add New Zone Alias and type in your domain and the zone you want it to map to:
Enable a CDN in WordPress
Next, we need to enable a CDN in WordPress. My preferred way of doing this is through W3 Total Cache, but you can also do this through the CDN Enabler Plugin (which is created by KeyCDN). First, under Performance > General Settings enable the CDN and sett the type to “Generic Mirror”.
Then, under Performance > CDN, enter the hostname of your CDN, static.protechig.com in my case.
Your site should now be serving content from KeyCDN’s servers.