Cloudflare is a popular CND service provider. CDN stands for Content Delivery Network and is used for caching websites and web pages. It significantly speeds up the website loading time. Caching also reduces load on the server.
Many web hosting companies include basic Cloudflare CDN in their Linux hosting plans. If you have cPanel, you can set up Cloudflare by configuring Drupal 8. In this guide, find the exact process you need to follow for that purpose.
Step-by-Step Process
Below are the steps you need to follow. These steps are meant for Drupal 8. Other versions of Drupal will have similar, if not exact, steps.
Now Cloudflare CDN is enabled for that domain.
Click on “Settings” besides the domain. You’ll see a list of settings options you can tweak. All of these are subjective and depends on your preference. But here are some settings options we recommend you select:
You’ll be prompted to get a paid account. But if you don’t need advanced options, you can stay with the free plan.
After downloading the modules, you need to install the files at “admin/modules/install”. You can also use FTP or Drush for this purpose.
The Cloudflare PHP SDK needs Composer as a prerequisite. So execute this command:
Once you’ve downloaded all the modules including Cloudflare, you’d have to configure them. Here are our recommended settings to apply:
Cloudflare Module
Enable these options:
Purge Module
Enable these options:
After installing and enabling the Purge module suite options, you’d have to navigate into the administrative panel and enable CloudFlare settings. Please note that you’d have to install the CloudFlare PHP SDK first using Composer first before you can install CloudFlare. The SDK works as a dependency.
To manage the cache performance, you can make changes at “admin/config/development/performance/purge” and use the Adv Agg module.
If you haven’t already, you must first install Drush on your web server. Then, open Drush and execute the following commands:
First, you have to download the Advanced CSS and JavaScript Aggregation (Adv Agg). Once installed, navigate into admin/config/development/performance to configure the settings.
Here’s what you need to enable from the Bandwidth Optimization settings panel:
Here are the steps to follow:
So that’s how you configure your Drupal 8 website in cPanel to start using Cloudflare CDN. After successful installation, you’ll notice an improvement in the page loading speed. For further assistance, get in touch with the customer support team.
Many web hosting companies include basic Cloudflare CDN in their Linux hosting plans. If you have cPanel, you can set up Cloudflare by configuring Drupal 8. In this guide, find the exact process you need to follow for that purpose.
Step-by-Step Process
Below are the steps you need to follow. These steps are meant for Drupal 8. Other versions of Drupal will have similar, if not exact, steps.
- Enable Cloudflare in cPanel
- Once inside cPanel, click on the Cloudflare icon
- Navigate into administration section where it lists all the domains
- Locate the domain for which you want to use CDN. Then enable Cloudflare on it
Click on “Settings” besides the domain. You’ll see a list of settings options you can tweak. All of these are subjective and depends on your preference. But here are some settings options we recommend you select:
- Cloudflare Caching Level: Basic
- Web Application Firewall: On
- Cloudflare Security Settings: Medium
- SSL Support: Full
- Image Optimization: Basic
- Install Supporting Modules
- Chaos Tools
- Purge
- URLS Queuer
- Cloudflare PHP SDK
The Cloudflare PHP SDK needs Composer as a prerequisite. So execute this command:
Code:
composerrequired8-contrib-modules/cloudflarephpsdk "1.0.0-alpha1"
Cloudflare Module
Enable these options:
- CloudFlare - CloudFlare CDN integration
- CloudFlare Form Tester - It adds the replacement services that can test CloudFlare forms
Enable these options:
- Purge
- Purge Drush
- Purge Tokens
- Purge UI
- Cron processor
- Late runtime processor
- Core tags queuer
- URLs queuer
- CloudFlare Purger
To manage the cache performance, you can make changes at “admin/config/development/performance/purge” and use the Adv Agg module.
- Enable Path-based Caching
If you haven’t already, you must first install Drush on your web server. Then, open Drush and execute the following commands:
- admin/config/development/performance/purge (to uninstall purge_queuer_coretags)
- drush en purge_queuer_url (to install purge_queuer_url)
- drush ev "deletefrom queue wherename = 'purge'"(to clear stale tag clear requests)
- drush cset system.performance cache.page.max_age31536000 (to clear stale tag clear requests)
- drush cache-rebuild (to empty page cache)
- Configure CSS, JS, and HTML Minification
First, you have to download the Advanced CSS and JavaScript Aggregation (Adv Agg). Once installed, navigate into admin/config/development/performance to configure the settings.
Here’s what you need to enable from the Bandwidth Optimization settings panel:
- Aggregate CSS files
- Aggregate JavaScript files
- Minified Source HTML
- Define Page Rules for Admin & Anon Users
Here are the steps to follow:
- Inside the cPanel Cloudflare panel, locate and select the domain
- Click on the link that reads “Page Rules”
- Click on “Create Page Rule” for building new filter system
- Enter the base URL
- Click on “Add a Setting”
- Select the new rule you just created to activate it
- Save the changes made and exit
So that’s how you configure your Drupal 8 website in cPanel to start using Cloudflare CDN. After successful installation, you’ll notice an improvement in the page loading speed. For further assistance, get in touch with the customer support team.