Magento CDN: The definition, benefits and how to configure it


Magento CDN (Content Delivery Network ) is one of the advanced solutions to improve your website loading speed. Basically the websites running their online business internationally are in trouble with the slow page load speed because of a long distance from the server.  Therefore, if your website have many visitors that are far from your server or if your store features a high number of images and videos, you may need to integrate the CDN into your Magento 2 website.

What is a Magento CDN  and Why it is  important?

As you know that Magento 2 is the best e-commerce software to power the online business. It is ranked in the top 3 popular platforms among the first million of ecommerce platforms on the Internet. And that’s exactly why the plenty of famous brands chose Magento for their business: such as Nike, Samsung, Ford, Monin, Coca-Cola, Helly Hansen, Mason Jars, HP, etc. However, if you are running a Magento ecommerce website, you may find that your load times are quite slow because of the large and complex system.

And Magento CDN is one of  effective tools to help your Magento 2 website solve visitor demands for massive amounts of data at lightning-fast speeds. Simply put, the speed of a Magento 2 website often bases on the hosting, i.e. where the website data is saved and the location of the hosting service. Therefore, let’s suppose that your Magento store is hosted at American data centers. If a customer visits your website from within America, they’ll find your website performing at its optimum in terms of loading speed. This is because of their proximity to the source of the data. But if you get a visitor from Asia, the Magento website will be slow because of the sheer distance between the source of the data and its target. Content Delivery Networks (CDNs) is a perfect solution to assist you overcome this conflict and provide a better user experience.

How CDN Work?

To minimize the distance between the users and your website’s server, a CDN stores a cached version of its content in multiple geographical locations (a.k.a., points of presence, or PoPs). Each PoP comes with a number of caching servers responsible for content delivery to users within its proximity.

In essence, CDN puts your content in many places at once, offering superior coverage to your visitor. For instance, when someone in London accesses your US-hosted website, it is done through a local UK PoP. This is much quicker than having the visitor’s requests, and your responses, travel the full width of the Atlantic and back. Not just that, this cached content can contains images of your products, CSS or JavaScript files, stylesheets, videos, and other fundamental keys that make sure the smooth operations. The data takes less time to travel when it’s hosted on a CDN, thus substantially reducing the load time.

In short, CDNs can help retailers and online businesses bring amazing customer experiences in a variety of ways. Besides the speedy loading of your Magento pages, these can draw in traffic from multiple platforms like YouTube, Facebook etc.  Furthermore, when you select a high-quality, well-configured CDN, it can help protect against spam and malicious attacks on your website.

View more Advantages of CDN for Magento 2 

How to configure Magento CDN in Magento ?

After learning about the great advantages of Magento CDN. Now, let’s dig into setting up a CDN on Magento 2. Unlike full-page cache, Content Delivery Network (CDN) is not fully integrated into Magento 2 Store, so you need to select and configure a CDN for own.

Step 1: Log in to your Admin Panel and navigate to Stores > Settings > Configuration.

Magento cdn
Step 2: In the panel on the left, under General, select Web

Magento cdn
Step 3: In the upper-left corner, set Store View if needed.
Step 4: Expand  the Base URLs section , and continue with following:

Magento cdn

  • In the Base URL for Static View Files field, enter the URL of the location on the CDN where static view files are stored
  • In the Base URL for User Media Files field, enter the URL of the JavaScript files on the CDN

Step 5: Click to expand the Secure section and continue with following

Magento cdn

  • In the Secure Base URL for Static View Files field, enter the URL of the location on the CDN where static view files are stored.
  • In the Secure Base URL for User Media Files field, enter the URL of the JavaScript files on the CDN.

Note: All these fields can be blank or start with the placeholder: {{unsecure_base_ url}}

Step 6: When fihish, click the Save Config button.


Magento 2 has many benefits for merchants, developers, and shoppers alike. These qualities are improved when the store is hosted with a CDN, creating a stellar shopping experience for  clients  with improved scalability, better performance, and stronger testing abilities. Magesolution hope all have implemented the above steps and achieved the advantage of improving the website speed by using the Content Delivery Network (CDN). In case any difficulties in the above steps then you can contact with Professional Magento Developer for customization of your Magento store.

516 Total Views 6 Views Today