Magento CDN integration
09 Oct 2013

Magento CDN integration

Magento CDN integration

Before you take any steps please back up your files and database

The domain “myproject.com” serves here as an example, replace it with the domain name of your website.

Create a CDN service in the CDNsun client section

    1. Log in or Sign up to CDNsun client section.
    2. On the Services tab choose New Service.
    3. Fill in the domain of your website and choose a domain for your new CDN service as in the picture below.

create_cdn

  1. That’s all.
  2. Now we use the Service Domain in Magento.

Enable CDN in Magento

    1. Login to your Magento Admin Panel.
    2. Click on “System” at the top navigation bar and select the “Configuration”.
    3. In the side menu under the “General” section click on the “Web” tab and then select the “Unsecure section”.
    4. Now we use Service Domain.
    5. Set “Base Media URL” to http://cdn.myproject.com/media/ and
    6. set “Base JavaScript URL” to http://cdn.myproject.com/js/ as in the picture below.

magento

    1. Note that you can alternatively use the Service Identifier instead of “Service Domain”. You find “Service Identifier” of your service in the CDNsun client section. It is located on the “Services” tab in the “Settings” section and also in the “How-To” section.
    2. Click “Save Config”.
    3. Select the “Current Configuration Scope” from the upper left drop-down and choose “Main Website”
    4. Then navigate to “Web > Unsecure > Base Skin URL”. Untick “Use Default for the Base Skin URL” and set “Base Skin URL” to http://cdn.myproject.com/skin/ as in the picture below.

magento2

  1. Click on “Save Config”.
  2. That’s all.

You are now using CDN.

View the page source of your website to verify it. You should see URLs of your images, CSS,.. beginning with the Service Domain.

Sincerely, CDNsun.

Leave a Reply