How to call the product images, skin ( CSS, images, js) from subdomain.

Example :

| improve this question | | | | |

If you want a ready-to-go solution I would go with the OnePica module that offers several integrations with CDNs from different vendors.

"Currently, the extension integrates with Amazon S3, Coral CDN, Mosso/Rackspace Cloud Files, and any CDN, server or service that supports FTP, FTPS, or SFTP. "


It's easy to configure and the code is pretty good.

| improve this answer | | | | |
  • 1
    +1 For OnePica ease of use to get Images on most any CDN easily. However, JS/CSS isn't implemented. Also here's a github link since connect is cumbersome github.com/onepica/imagecdn – B00MER Feb 18 '15 at 8:25
  • I dont recommend this module because it does not support load balance. – Eduardo Dec 29 '15 at 15:56
  • How to set font icon url using cdn server in magento2? – Rakesh Jesadiya Apr 27 '16 at 6:36

To call skin/media/js from different domains you can edit the base urls under System -> Configuration -> General -> Web -> Unsecure. e.g.

enter image description here

Secure domains can probably be left as normal so that you dont need to worry about SSL certs.

Obviously you also need to set up the domain names, they will need to point to your CDN. The CDN setup will depend on your provider.

IMHO another must with a CDN is a method of invaliding your JS and CSS files from Magento. A good way to do this is to change the url of the asset, this means that the CDN will see it as a different file affectively forcing a reload. This extension for example will add a timestamp to the url of your files when you clear your JS/CSS cache in Magento.

| improve this answer | | | | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.