You are viewing the legacy StackPath SecureCDN Help Center. Please use support.stackpath.com if you signed up after July 1, 2018 or log in through control.stackpath.com

StackPath Support

Drupal: StackPath CDN Setup Guide

The SecureCDN module for Drupal alters URLs so static content loads from CDN servers instead of the origin server. After completing this tutorial, static content will be delivered from StackPath CDN.

This tutorial assumes a site is created

Configuration

The CDN module for Drupal provides two modes: Origin Pull and File Conveyor. For setting up Drupal to use StackPath CDN, use Origin Pull. This mode is used as a domain name rewriting tool.

  1. Log in to the Drupal admin panel. Select Modules, then select Install New Module.

  2. 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, then click Install.

  3. Select Configuration, then scroll down and select CDN. In the General tab, tick the Enabled radio box, then click Save Configuration.

  4. Select Details, then select Origin Pull. For the CDN Mapping box, enter your CDN URL in the following format: http://site.company.stackpathdns.com

  5. Replace this example URL with the CDN URL for your site.

  6. Click Save Configuration.

The StackPath CDN should be properly integrated into Drupal. To test, ​view the source code of any page to confirm that your CDN URL is being used to deliver static assets. For example, for a given image, instead of seeing yourdomain.com/images/photo-270/ you should see http://site.company.stackpathdns.com/photo-270/.

If the CDN domain is not present, follow the steps below. In some cases, changing default Drupal functions is needed.

Further Configuration

  1. Navigate to Admin → Settings → Performance.

  2. Enable Normal Caching.

  3. Disable Page compression, Block cache, Optimize CSS files and Optimize JavaScript files, then select Clear cached data.

  4. Navigate to Admin → Settings → Advagg → Config.

  5. Disable Enable Advanced Aggregation, Use AdvAgg in closure and Gzip CSS/JS files, then select Flush AdvAgg Cache.

  6. Navigate to Admin → Settings → Advagg → Bundler.

  7. Disable Bundler is Active.

  8. Navigate to Admin → Settings → Advagg → Css-Compress

  9. Disable Compress CSS Files and Compress Inline CSS.

  10. Navigate to Admin → Settings → Advagg → Js-compress

  11. Disable Compress JS Files, Compress Inline JS and Enable Packer

View the source code again. The CDN URL should now precede the file name of all static assets.

Return to top