The following guide will walk you through how to use Durpal with your MaxCDN.
This tutorial assumes you have already created a Pull Zone.
Installation
The CDN module add-on for Drupal will alter URLs, so your static content will load from the CDN servers, as opposed to your origin server. The module provides two modes: Origin Pull and File Conveyor. For setting up the site to use our CDN you need to only use Origin Pull, which is basically used as a domain name rewriting mode.
- Login to your Drupal admin panel, select Modules", then click Install New Module.
- In the Install from a URL box, enter the CDN Module URL:
http://ftp.drupal.org/files/projects/cdn-7.x-2.6.zip
(check the official Drupal CDN Project Page for the newest stable version), and select Install. - Now select Configuration, then scroll down to select on CDN. In the General tab, tick the Enabled Radio Box then select Save Configuration.
- Select Details then select Origin Pull. For the CDN Mapping box, enter the CDN URL in the following format:
http://foo.bar.netdna-cdn.com
Please note that the URL should be replaced with the original CDN URL you have). - Click Save Configuration.
Your website should now be using CDN services, and you can confirm this by reloading your website and viewing the page source. If your Origin URL is rewritten to the CDN temporary URL you are all set.
Adjustments
In some cases you will have to tweak some default Drupal functions in order to properly implement the CDN:
- Navigate to admin → settings → performance
- Enable normal caching.
- Disable Page compression, Block cache, Optimize CSS files and Optimize JavaScript files then select Clear cached data.
- Navigate to admin → settings → advagg → config
- Disable Enable Advanced Aggregation, Use AdvAgg enclosure and Gzip CSS/JS files then select Flush AdvAgg Cache.
- Navigate to admin → settings → advagg → bundler
- Disable Bundler is Active.
- Navigate to admin → settings → advagg → css-compress
- Disable Compress CSS Files and Compress Inline CSS.
- Navigate to admin → settings → advagg → js-compress
- Disable Compress JS Files, Compress Inline JS and Enable Packer.
To ensure you implemented MaxCDN correctly, you can view the source code of any page to confirm that the CDN domain is being used for static assets instead of your origin domain. You can also use tools like pingdom, gtmetrix, >webpagetest that can give you more detailed reports on your CDN implementation status.
As always, If you have any questions or concerns about any of the topics mentioned in this article, please feel free to reach out to support - we are available 24/7 by chat or email.