Magento Commerce 2.1.x
Using a Content Delivery Network

Storing media files in a CDN is another alternative supported in Magento. There is no full integration with a specific CDN, and you are responsible for choosing and configuring a CDN on your own.

After configuring the CDN, you must complete the configuration from the AdminThe password-protected back office of your store where orders, catalog, content, and configurations are managed.. The changes can be made at either the global or website level. When a CDN is used for media storageA dedicated space on the content delivery network for your store's assets., all paths to media on store pages are changed to the CDN paths that are specified in the configuration.

Important! For security, when a CDN is used as media storage, JavaScriptA scripting language used with HTML to produce dynamic effects and interactions on web pages. may not function properly if the CDN is located outside of your subdomain.

To configure a content delivery network:

1. On the Admin sidebar, tap Stores. Then under Settings, choose Configuration.
2. In the panel on the left under General, choose Web.
3. In the upper-left corner, set Store View as needed.
4. Expand the Base URLs section. Then, do the following:
a. Update the Base URL for Static View Files with the URL of the location on the CDN where static view files are stored.
b. Update the Base URL for User Media Files with the URL of the JavaScript files on the CDN.

Both these fields can be left blank, or can start with the placeholder: {{unsecure_base_url}}

5. Expand the Base URLs (Secure) section.
a. Update the Secure Base URL for Static View Files with the URL of the location on the CDN where static view files are stored.
b. Update the Secure Base URL for User Media Files with the URL of the JavaScript files on the CDN.

Both these fields can be left blank, or can start with the placeholder: {{unsecure_base_url}}

6. When complete,tap Save Config.