XenForo CDN Integration

This tutorial shows how to complete a XenForo CDN integration with KeyCDN.

  1. Create a pull zone before you start with the XenForo CDN integration.
  2. Navigate to the document root of your XenForo installation. We recommend to use your FTP account.
  3. Add the following code to the file library/config.php using your own CDN URL such as http://yourzone-ab12.kxcdn.com
  4. $config['externalDataUrl'] = 'http://yourzone-ab12.kxcdn.com/data';
    $config['javaScriptUrl'] = 'http://yourzone-ab12.kxcdn.com/js';
  5. Log in to your XenForo control panel and navigate to “Appearance” → “Styles” → [Your Style] → “Style Property Groups” → “General” → “Settings.”
  6. In the field “Path to Images” replace default “styles/default” with “http://yourzone-ab12.kxcdn.com/styles/default” and click on the “Update Style Properties” button to apply your new settings.  xenforo CDN integration
  7. Up one directory, navigate to “Header and Navigation” → “Settings.”
  8. Confirm that the “Header Logo Image Path” is using the @imagePath command. If you hard code the complete URL your logo will not serve correctly from the CDN.
    xenforo CDN header logo

That’s it. Check the HTML in order to make sure the URLs have been rewritten properly.

Important: When using avatars in Xenforo, the feature Ignore Query String needs to be disabled. It’s recommended to purge the whole zone after this zone change.

Also make sure to check out our additional recommendations on how to speed up Xenforo.

Leave A Comment?