Drupal CDN Integration

Before you take any steps please backup your site and database.

1. Install the Drupal CDN module:

  • Download one of the recommended releases of Drupal CDN module from the Drupal.org website (You do not need to unzip this file).

  • Log into your Drupal administration section.

  • Click on Modules tab in the top navigation bar.

  • Click on Install new module link.

  • Click on Choose File button and browse to the Drupal CDN module you downloaded.

  • Click on Install button to install the extension into your website.

  • Click on the link Enable newly added modules.

  • Scroll down till you find the CDN module and check “enabled”. Click on Save configuration.

2. Configuring the Drupal CDN module with our CDN:

Scroll back down to the CDN module. In Operations column click on “Configure”. You will be forwarded to the CDN configuration page consisting of three tabs: General, Details, and Other.

configure CDN module

 

3. General tab of the CDN module:

There are only three simple options you can choose: enable, disable or testing mode.

Testing mode means that none of your visitors will get files from the CDN; only users with permission to access files on CDN will be able to see it. This is ideal for testing whether the CDN integration is actually working correctly.

Next setting on this tab is Display statistics setting, which enables every user with permission to see the per-page statistics at the bottom of the page.

general tab

4. Details tab of the CDN module:

It provides two modes: Origin Pull and File Conveyor. If you are unsure which mode to use, choose Origin Pull, which is also the default setting. It will replace your domain name with the Origin Pull CDN's domain name in the file URL.

Next, there is the CDN mapping setting. Here you can define which files are mapped to which CDN (in case you’re using multiple CDNs or static file servers). Paste your CDN URL or CNAME here.  If you’re not using a CNAME you can retrieve the CDN URL by logging into the management area of your CDN Resource. This will cause all files to be served from CDN77.

The last setting is optional but recommended - the Far Future expiration. Check this box if you want your site to run much faster. It routes the serving of all static resources through Drupal instead of the web server (Apache/nginx/lighttpd/…) and ensures that all files are served from the CDN in the optimal way. i.e. files are compressed (gzipped) and have optimal HTTP headers. These HTTP headers tell your visitors’ browsers to cache files “forever.” The URL of the changed file is updated automatically, so your visitors receive the new files immediately. However, to make this work correctly you have to serve the files through PHP (Drupal), not the web server, which is not very efficient. Alternatively, you can set cache expiration time for your CDN long enough for this to still be ok.

origin pull

Now you can browse your site and check CDN integration statistics at the bottom of the page when in testing mode. If everything looks ok, just enable the module and you're all done, your site is now being accelerated by CDN77!