How to Enable Cloudflare CDN
Step 1: Access CDN Support
- 1. Go to WordPress admin dashboard → CompressX plugin.
- 2. CDN support.
Step 2: Select Cloudflare as Your CDN Provider
- 1. Navigate to CDN Support.
- 2. Locate the CDN Provider section.
- 3. From the dropdown menu, select Cloudflare.
Once selected, the Cloudflare Integration settings panel will appear.

Step 3: Enter Your Cloudflare Credentials
Authenticate your connection by entering your API Key or API Token. The following fields are required:
Option 1 : API Key
- 1. Global API Key:
A key for granting access to Cloudflare API to perform actions. You can find it in your Cloudflare dashboard > My Profile > API Tokens > Global API Key. - 2. Cloudflare Email:
Email address associated to your Cloudflare account. - 3. Zone ID:
A zone ID is generated automatically when a domain is added to Cloudflare and is required for API operations. You can find it in your Cloudflare Dashboard > The website overview > API section.
Option 2 : API Token
- 1. API Token:
A token for securely authenticating requests made to the Cloudflare API. You can create a token from your Cloudflare dashboard > My Profile > API Tokens > Create Token. - 2. Zone ID:
A zone ID is generated automatically when a domain is added to Cloudflare and is required for API operations. You can find it in your Cloudflare Dashboard > The website overview > API section.
Step 4: Configure Cloudflare Cache Features
Under the Features section, you can enable or disable cache-related options:
For CompressX Free:
- 1. Purge cache automatically after bulk image optimization: Automatically clears Cloudflare cache after bulk image optimization.
- 2. Purge cache automatically after manual image conversions (5 min delay): Automatically purges the cache after manual image conversions, incorporating a five-minute delay to prevent excessive API requests.
- 3. Purge All Cloudflare CDN Cache Manually: If needed, you can manually clear the Cloudflare CDN cache at any time.
For CompressX Pro:
In addition to the caching features mentioned above, the Vary for Images feature is exclusively available in CompressX Pro.
- Vary for Images: Enable Cloudflare’s Vary for Images feature to ensure the correct image variants—such as WebP, AVIF, or JPEG—are served based on browser compatibility.
The Vary for Images feature is available exclusively with paid Cloudflare plans.
After configuring your CDN settings, click Save Changes to apply the updates and activate the integration.




