In this KB:
- Download and Install Drupal CDN Module
- Integrate CloudwaysCDN With Drupal
- Verify CloudwaysCDN After Integration
We assume that you have already activated the CloudwaysCDN for your Drupal application. If not, please visit this KB before proceeding further.
Step 1: Download and Install the Extension
The official Drupal CDN Module provides secure Content Delivery Network (CDN) integration for your Drupal sites. It changes static file (CSS, JS, Image, Font, Video, etc.) URLs so that these resources are served directly from the CDN instead of the web server.
To download Drupal CDN Module, visit this link.
Note: There are two versions for Drupal CDN Module, one for Drupal 7, and one for Drupal 8. Download the appropriate version for your Drupal application to proceed further.
Step 2: Integrate CloudwaysCDN
Login to the Cloudways Platform and go to Application Management tab. Click the CloudwaysCDN option and a new screen. On this page, you can find the Website URL and the corresponding CDN URL.
For Drupal 7
Login to your Drupal 7 Admin Panel:
Click Modules, and tap Install New Module.
Upload the Drupal 7 CDN Module file that you downloaded earlier, and click the Install button. After the installation finishes, enable the CDN module.
Now, click Configuration and under DEVELOPMENT section, tap CDN.
Select the Enable radio button, and click the Save configuration button.
Next, click the Details tab, select Origin Pull as Mode, and in the CDN mapping box, enter the CDN URL using the format shown in the below screenshot.
Click Save Configuration button, and you’re done!
Login to Drupal 8 admin panel.
Click Extend in the menu item, and tap Install new module button.
Upload the Drupal 8 CDN Module file that you downloaded earlier, and click Install button. After the installation finishes, enable the CDN module.
Now, click Configuration, and under WEB SERVICES section, tap CDN integration.
Set the Status to Enabled, select simple in mapping drop-down, and enter your CDN URL that you got from the CloudwaysCDN.
Tap Save configuration button and you’re done!
Step 3: Verify CloudwaysCDN on Drupal
To confirm that your Drupal website is using the CDN services, visit the frontend of your application, and press CTRL+U to view the page source. Search for StackPath, and if your Origin Domain is replaced by the CDN URL, the CloudwaysCDN is successfully set up.
Now you know how to install CloudwaysCDN for your Drupal application.