Magento Open Source 2.2.x
Using a Content Delivery Network

A Content Delivery NetworkA large distributed network of servers that specializes in the high performance delivery of multi-media content. (CDN) can be used to store media files. Although the version of Magento that is installed “on premise” does not include an integration with any specific CDN, you can use the CDN of your choice. Magento Commerce (Cloud) is an exception to this, and includes the Fastly CDN. To learn more, see Fastly in the Magento developer documentation.

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.