Custom (No CMS)

Implementing CDN on your website

Background Information

Generally speaking, a CDN is a global network of servers used to increase a website’s performance by decreasing server load at the host server and delivering content to end-users from a closer proximity. There are two simples steps to complete before you can integrate your site with our CDN

  1. Point the CDN to your Origin The network needs to know the location of your origin server which you will provide to us during the pull zone creation.
  2. Moving Files to the CDN For the case of a pull zone, the moving of files onto the CDN is handled automatically by our network. This movement takes place upon the first request for a given file, and at this point the file is copied onto our server into a mirrored directory from that on your origin (example 1).

Integration Requirements

  1. Properly configure your Pull Zone, be aware of the following pertinent information. If you did not record this during the pull zone creation you can find the information in our control panel: ORIGIN_URL – The URL to your website’s origin (often just www.domain.com) ZONE_URL – The URL to your CDN pull zone. This can be either the Temporary URL (just a name, it will not expire) we provided to you upon the zone creation, or it can be a CNAME that you created that points to the Temporary URL
  2. Adapt your Source Code to Pull Static Content from the CDN The beauty of the way pull zones grab content is that to integrate your website, you simply need to replace your ORIGIN_URL with your ZONE_URL in the links of the static content you want served by the CDN (example 2). There are two main categories of integration methods for pull zones:
  • Popular CMS If your site is built off of a popular CMS, chances are that we have an automated solution available for you. In this case, please visit http://support.maxcdn.com/ and view the “Integration” category in the top navigation to find out if your CMS is included. If it is, simply follow the instructions listed there and you should be integrated in no time.
  • Custom Integration If you are implementing this with a custom built site, you will need to go into the source code and make the changes yourself. You will need to manually point all of your static content to it’s corresponding location on the CDN by replacing your ORIGIN_URL with your ZONE_URL. See example 2 below for general examples of this replacement.

Examples

Location of Files on the CDN Pull zones will mirror the static contents of your origin onto our network. Meaning that if you have a file on your origin located at ORIGIN_URL/images/logos/big.jpg, Its location on our CDN would be ZONE_URL/images/logos/big.jpg.

Replacing URLs in HTML Elements for Static Content The HTML output of your website’s source code needs to be changed for the static elements you want served by the CDN. Here are some examples for:

- An Image

- A Stylesheet

- A Script

Any other static file Any other static file under 10 MB can be served through the CDN in a similar fashion