Patch Drupal core to serve static content from a CDN. This patch will serve user-uploaded files (if using public downloads), CSS files, JavaScripts, and theme images from a CDN.

To serve all of the above content from a single CDN path, set the 'cdn_base_url' variable. To serve one or more of the above from a different path, set one or more of the following variables: 'file_base_url', 'css_base_url', 'js_base_url', and 'theme_base_url'.

For example, if you would like to serve all static content from the domain '', edit settings.php and set 'cdn_base_url' to ' If you would like to serve CSS files and JS files from, also in settings.php set 'css_base_url' and 'js_base_url' both to ''.

As a specific example:

  $conf = array(
    'cdn_base_url' => '',
    'css_base_url' => '',
    'js_base_url' => '',

This patch has not been merged into any release of Drupal.


Original patch source:…

Modified to use Drupal variables to define path to CDN, and ported to Drupal 6.