November 12, 2015
This tutorial assumes you have already created a Pull Zone.
OpenCart CDN Integration
- Download the CloudCache OCXXX.zip module from official module web page
- Upload the “admin” and “system” folders from the CloudCache module to the root path of your website.
- Go to the admin panel of your OpenCart store and open the modules list on Extensions → Modules.
- Click on the “install” button on the right side to install the module.
- After the installation is done, list the modules again and go to the “edit” button on the right side of modules list in the CloudCache module row.
- Enable the module by selecting the “Enabled” option on the drop-down list.
- Enter the Custom Domain or temp URL (e.g foo.bar.netdna-cdn.com) in provided text box.
- Check which file types you would like the CDN to deliver.
- Click on “Save” button to save all changes.
- After everything is done and if you don’t see CDN URLs being used in your source code, you should check if opencart is pushing compression and if it does, disable it:
- Login to your OpenCart admin Dashboard.
- Navigate to System -> Settings.
- Next to your store click on Edit button.
- Find Server tab.
- Find Output Compression Level and set it to
- Save setting by hitting Save button.
In some cases you may encounter an error displayed on top of the page (frontend or backend/admin area) pointing out the variable HTTP_IMAGE:
Notice: Use of undefined constant HTTP_IMAGE – assumed ‘HTTP_IMAGE’ in /system/library/response.php on line 79
To solve this, you need to open /config.php and add a definition for HTTP_IMAGE on the top of the file, so that resulting file looks like:
<?php // HTTP define('HTTP_SERVER', 'http://domain.com/'); define('HTTP_IMAGE', 'http://domain.com/image/'); // HTTPS define('HTTPS_SERVER', 'http://domain.com/opencart/');
Do not download the vQmod version, use the OCXXX.zip module instead or download it from here.
Change “foo.bar.netdna-cdn.com” to whatever your temp URL or custom domain is.
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.