How to Add CDN to Drupal 7 and 8

by Hamza Zia  November 2, 2017

There are a variety of measures that can improve the performance of your Drupal site. Though, the best one amongst all is to add a CDN to your site. Content Delivery Network (CDN) basically uses it’s own location to deliver site content to the user, negating the need for contacting the host location again and again. Essentially, this helps in speeding up the website.

Add CDN to Drupal 7 and 8

In this guide, I’ll be showing you how to add Cloudways CDN to your Drupal site. Cloudways partnered with Stackpath to bring you one of the best CDN solutions out there.

Launch Drupal on Your Cloudways Server

First and foremost, head on over to your Cloudways server and launch your desired version of Drupal.

Add Drupal Cloudways

Add Site Name and Apply CDN

Now, go over to your application’s dashboard and navigate to the CloudwaysCDN tab.

CDN tab Drupal

Now, add your site’s address to the Website URL field.

Website URL CDN Cloudways

Once you’re done, click CREATE and you will be presented with the following screen.

Cloudways CDN Details

Install and Enable Drupal CDN Module

Now download the Drupal CDN module. The links for both Drupal 7 and Drupal 8 are available here. Once installed, enable the module and move on to the next steps.

Install CDN on Drupal 7

Navigate to settings for the CDN module by going on to admin->modules and clicking the Configure button for CDN.

CDN module configuration button

Now select enabled on the screen that pops up.

CDN Module settings

After this, navigate to the details tab at the top right. Here, you will be required to copy the CDN URL to the CDN Mapping field. Your CDN URL will be found in the CloudwaysCDN section in your application dashboard.

CDN URL

Paste the URL in the highlighted section.

CDN module URL field

Remember to add the http:// prefix with the URL. When done, save the configuration and remember to clear all the caches.

Install CDN on Drupal 8

Navigate to the CDN settings by navigating to admin->configuration->CDN Integration. Now, in the mapping tab, copy the CDN URL from your application’s dashboard (as shown in the last step) and paste it in the highlighted field.

CDN Module drupal 8 URL Field

Save the configuration and remember to clear all the caches.

Test CDN

To check if CDN has been successfully integrated, simply refresh your site and note the address that your browser fetches from.

Test CDN

Conclusion

That’s it! Adding a CDN to your Drupal site is a pretty straight-forward procedure when using Cloudways. Needless to say, it gives your Drupal website a massive speed boost. If you are looking to further speed up your Drupal site, see our blog post on, 10 Tips To Speed Up Your Drupal Website. Hope you found this guide useful. If you have any queries, feel free to leave a comment.

 

Start Creating Web Apps on Managed Cloud Servers Now!

Easy Web App Deployment for Agencies, Developers and E-Commerce Industry

About Hamza Zia

Hamza is a Drupal Community Manager at Cloudways - A Managed Drupal Hosting Platform. He loves to write about Drupal and related topics. During his free time, he can be seen obsessing over Football, Cars, Android and Gaming.

Stay Connected:

You Might Also Like...