We accelerate websites

15 days free trial Sign up

Media Acceleration Stream to the world

15 days free trial Sign up

Extensive Network Excellent world coverage

Opencart CDN integration

Before you start

  • Before you take any steps please back up your files and database.
  • In the following we are going to integrate a CDN service using its CDN domain 12345.r.cdnsun.net. Please refer to Services/How-To for your CDN domain.
  • If you are going to integate a CDN service also on https:// pages then you must use CDN domain with SSL enabled.
  • If your website embeds custom fonts then please first enable CORS for them.
  • Before you take any steps please make sure that your CDN domain is ready-to-use here.

Create CDN Static service

Please refer to Creating a CDN Static service for more details.

Enable CDN in Opencart using CloudCache extension

  1. Download the CloudCache extension.
  2. Upload admin and system folders to the document root of your Opencart website.
  3. Log in to the admin panel of your Opencart.
  4. Go to ExtensionsModules.
  5. Click on the install button on the right side.
  6. Now we need to do two minor changes in the extension source code.
    1. Open file /admin/controller/module/cloudcache_cdn.php, find private function validate and at the first line of the function body add.

      private function validate() {
            return true;
                   

      Save the file.

    2. Open file /config.php and at top of the file add.

      <?php
      define('HTTP_IMAGE',   'http://12345.r.cdnsun.net/image/');              
                     

      Save the file.

  7. Go back to ExtensionsModules
  8. Click the edit button on the right side of modules list in the CloudCache row.
  9. Enable the extension and fill in your CDN domain as in the picture below.
    Opencart CloudCache
  10. Click Save.
  11. That's all.

Notes

  • View HTML source code of your web pages to verify that you are using CDN, you should see source attribute of your images, CSS, JavaScript, etc. beginning with your CDN domain.
  • Don't see your CDN domain in source code of your web pages? If your website is using any cache plug-in/mechanism then you might want to clear/flush its cache.
  • Having troubles with custom fonts? Please refer to Using custom fonts with CDN - setting CORS for more details.
  • Still having troubles? Check your CDN URLs in our CDN content check or please refer to Debugging a CDN service for more hints.
 
 _____     _    _      _____   __   __  
|  __ \\  | || | ||   / ___//  \ \\/ // 
| |  \ || | || | ||   \___ \\   \ ` //  
| |__/ || | \\_/ ||   /    //    | ||   
|_____//   \____//   /____//     |_||   
 -----`     `---`   `-----`      `-`'   
                                        
Europe
  • Athens
  • Baku
  • Bucharest
  • Budapest
  • Chelyabinsk
  • Copenhagen
  • Dubai
  • Dublin
  • Helsingborg
  • Helsinki
  • Istanbul
  • Kharkov
  • Kiev
  • Kungalv
  • Lisbon
  • London
  • Lvov
  • Madrid
  • Odessa
  • Oslo
  • Polevskoy
  • Rostov-on-Don
  • Saint Petersburg
  • Samara
  • Stockholm
  • Tel Aviv-Yafo
  • Trondheim
  • Zagreb
America
  • Arlington
  • Atlanta
  • Chicago
  • Dallas
  • Denver
  • Green Bay
  • Los Angeles
  • Miami
  • Montreal
  • New York
  • Phoenix
  • Portland
  • Provo
  • Queretaro
  • Reston
  • Sacramento
  • San Jose
  • Sao Paulo
  • Seattle
  • Toronto
  • Washington
Contact
  • e-mail: info@cdnsun.com
  • skype: cdnsun.com
  • phone: +1 844 300 9206
  • phone: +420 776 256 872
Blog Twitter LinkedIn Facebook CrunchBase Google+ / Google plus Foursquare Pinterest