Support

Find answers, guides, and tutorials to supercharge your content delivery.

Complete CDN Migration Guide

Updated on October 4, 2018

This guide describes the step-by-step process of how to setup a CDN to migrate the delivery your website’s static assets to KeyCDN’s server locations. Once the below steps are complete, you will have successfully created a KeyCDN Zone, integrated it with your website, and will be delivering assets from KeyCDN’s edge servers.

1. Creating a Zone

The first step in how to setup a CDN is creating a Zone within KeyCDN. A Pull Zone automatically pulls all of your origin server’s static content and caches at a particular edge server location upon client request. Once the content is cached, subsequent client requests will be routed to the nearest edge server location.

To setup a KeyCDN Pull Zone complete the following steps.

  1. Login to the KeyCDN dashboard and click on Zones then Add New Zone.
  2. Define a Zone name and ensure the Zone type is set to Pull.
  3. Enter the origin URL where you want to content to be pulled from (e.g. https://mywebsiteurl.com) and click Save.

The status of the new Zone will now be set to deploying. This remains for about 5 minutes before the status changes to active and the Zone is ready for use.

Alternatively, using a Push Zone is recommended for uploading files greater than 10MB in size and is required for files larger than 100MB (Pull Zones don’t cache anything over 100MB).

2. CDN DNS Changes (CNAME)

Once your Zone is created, you have the option to use the Zone URL (e.g. demozone-1c6b.kxcdn.com) which is provided on the KeyCDN Zones page for integration purposes.

Alternatively, a Zone Alias can be created which will provide you with a custom CDN URL (e.g. cdn.yourwebsiteurl.com). Creating and implementing a Zone Alias involves adding a record in your DNS settings which is outlined in the steps below.

  1. Create a CNAME record which points your Zone Alias to your Zone URL.

    DNS propagation may take some time depending on your TTL settings. Use the DNS check tool to verify your new record is fully propagated. You may also verify this from the terminal using a dig command.

    dig cdn.keycdn.com +short
    website-7.kxcdn.com.
    
  2. Login to the KeyCDN dashboard and navigate to Zone Aliases.

  3. Select “New Alias” and set the Zone Alias to reflect what was defined in your CDN DNS CNAME record (e.g. cdn.demosite.com).

  4. Select the Zone you would like the alias to map to and click Add.

A Zone Alias also typically requires 5 minutes before it is fully deployed and ready for use.

3. Verifying Your Assets Are Accessible via the CDN

Now that you have a Zone created and a Zone Alias defined, test an asset path using the CDN URL to verify your assets are being properly delivered via the CDN. For example, take the origin URL for a particular asset such as

http://yourwebsiteurl.com/wp-content/themes/twentyfifteen/style.css?ver=4.4.1

and replace the domain by the Zone Alias you created in step 2. In this case, the new URL is

http://cdn.demosite.com/wp-content/themes/twentyfifteen/style.css?ver=4.4.1

If by accessing an asset via the CDN URL is successful, then your Zone is fully propagated and you can now move on to the integration phase.

4. Integrate KeyCDN Into Your Website

Once this step is complete, your website will be fully integrated to use KeyCDN to deliver your static assets. We have many CMS integration and Framework Integration guides available, however this article will specifically focus on a WordPress KeyCDN integration.

  1. The first step is to download a plugin such as the WordPress CDN Enabler plugin to integrate your CDN URL with your website.
  2. Once the plugin is installed and activated, navigate to the settings page of CDN Enabler and enter your Zone URL or Zone Alias (if you created one).
  3. Save your settings and double check your site’s page source to ensure that your static file URLs have been rewritten.

4. Checking Logs and Statistics

Now that your site is fully integrated with KeyCDN, your static assets will be delivered via our content delivery network across the globe to supercharge your content. As content is delivered via the CDN, logs and statistics are tracked and accessible via the KeyCDN dashboard. These can be accessed via the Reporting option on the left-hand sidebar. Detailed charts display various information pertaining to your Zones such as usage, analytics, real-time logs, real-time stats, etc.

For a detailed explanation of the analytics available, read our article Analyzing CDN Traffic to your Website.

For a more granular view of your logs, KeyCDN also allows you to perform log forwarding and have your logs received by syslog.

Other Considerations

Supercharge your content delivery 🚀

Try KeyCDN with a free 14 day trial, no credit card required.

Get started
KeyCDN uses cookies to make its website easier to use. Learn more about cookies.