Before you take any steps please backup your site and database (just to be sure).
1) Install the Drupal CDN module:
- Download one of the recommended releases of Drupal CDN module from 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 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 Save configuration.
2) Configuring the Drupal CDN module with our CDN:
Scroll back to the CDN module. In the Operations column click on Configure. You will be forwarded to the CDN configuration page consisting of three tabs: General, Details, Other.
‘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 per-page statistics at the bottom of the page.
‘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. 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 (you can find these entries under CDN List in CDN77 client section). 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: compressed (gzipped) and with 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.
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 accelerated by CDN!