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

Introduction

OpenCart is an eCommerce platform which was designed to create eCommerce websites of various sizes. It is able to provide you with a ready-made eCommerce online resource without a need to write HTML code. Here are several reasons why to choose OpenCart:

  • It is rich in various plugins.
  • It is MVC (Model-View-Controller) based.
  • It has a clear and easy to manage admin panel.
  • You can use it free of charge.

If you want to provide your customers with good loading speed, you need to use CDN, read our instructions how to integrate CDN with OpenCart.

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
  • Amsterdam
  • Athens
  • Baku
  • Bucharest
  • Budapest
  • Copenhagen
  • Dubai
  • Dublin
  • Frankfurt
  • Helsingborg
  • Helsinki
  • Karlskrona
  • Khabarovsk
  • Kharkov
  • Kiev
  • Kungalv
  • Lisbon
  • London
  • Lvov
  • Madrid
  • Moscow
  • Odessa
  • Oslo
  • Polevskoy
  • Saint Petersburg
  • Samara
  • Stockholm
  • Ufa
America
  • Arlington
  • Atlanta
  • Bogota
  • Buenos Aires
  • 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