Skip to content

Setting up cloudflare with Super cache

Integrating Cloudflare with Super Page Cache creates a powerful dual-layer caching system that dramatically improves your website's global performance. This guide will walk you through the complete setup process, optimization strategies, and troubleshooting steps.

In this article

Understanding the Cloudflare + Super Page Cache Stack

How It Works Together

Layer 1: Cloudflare Edge Cache

  • Serves cached content from global edge locations
  • Reduces server load and improves international performance
  • Handles static assets (images, CSS, JS, fonts)

Layer 2: Super Page Cache

  • Generates and serves cached HTML from your server
  • Handles dynamic content caching
  • Provides server-level optimization

Benefits of Integration

  • 60-90% faster load times globally
  • Reduced server resource usage by up to 80%
  • Enhanced security with Cloudflare's protection
  • Better SEO performance with improved Core Web Vitals

Prerequisites

Before starting, ensure you have:

  • Active Super Page Cache plugin installed and working
  • Cloudflare account (free tier is sufficient to start)

Note: If you don't have a Cloudflare account, then you can create one by following this guide. Also, please ensure you add your site to Cloudflare and all DNS records are configured correctly. You can check this guide for more information.

Step-by-Step Integration Process

  1. Go to WordPress Admin → Super Page Cache → Settings

  2. Navigate to the Cloudflare Integration tab

  3. Select the API Key or API Token method from the Authentication Mode dropdown.

  4. Enter your Cloudflare credentials.

  5. Click on the Connect to Cloudflare button.

  6. After this, Select the Zone from the dropdown.

  7. Turn on Enable Cloudflare CDN & Caching, then click Save Changes.

📝 Note: Connecting or reconnecting your Cloudflare API credentials only authorizes the plugin to access your Cloudflare account. Cloudflare caching will stay inactive until you enable Enable Cloudflare CDN & Caching and save your settings.

If you see API token permission or scope errors while connecting, follow the Super Page Cache Cloudflare Permissions guide.

If the zone dropdown does not load or the settings screen freezes after connecting, see Troubleshooting: Cloudflare zone dropdown is blank or frozen.

Verification of Cloudflare Integration

Test 1: Check within the Plugin

  1. Click on the Test Cache button inside the plugin.
  2. A popup will show with the results.

Test 2: Check Cache Headers

  1. Open your website in Incognito tab in your browser.
  2. Press F12 to open Developer Tools
  3. Go to Network tab and refresh the page and check the first request of your domain( e.g. example.com)
  4. Look for these headers in the response:
    • CF-Cache-Status: HIT (Cloudflare cache)
    • x-wp-spc-disk-cache: HIT (Super Page Cache)

If Cloudflare shows connected but inactive

  1. Confirm your Cloudflare API connection is successful in the Cloudflare Integration tab.
  2. Make sure you selected the correct Zone for this WordPress site.
  3. Confirm Enable Cloudflare CDN & Caching is turned on.
  4. Click Save Changes.
  5. Purge the plugin cache and Cloudflare cache.
  6. Run the header check again and confirm you can see CF-Cache-Status: HIT.

If the Cloudflare Cache Rule was not created

When you turn on Enable Cloudflare CDN & Caching and click Save Changes, Super Page Cache creates a managed Cache Rule in your Cloudflare zone. That rule is what tells Cloudflare how to cache your pages at the edge. Connecting your API credentials alone does not create it — the rule is created or refreshed only after you select the correct Zone, enable the setting, and save.

If your Cloudflare cache hit rate is low and you cannot find this rule in Cloudflare, work through the steps below.

Verify the rule exists in Cloudflare

  1. Log in to your Cloudflare dashboard and select the zone for this site.
  2. Go to Caching → Cache Rules.
  3. Look for a rule whose description begins with WP Super Page Cache Plugin rules for followed by your site URL. This is the rule the plugin manages for you.

📝 Note: This rule is labeled [DO NOT EDIT] because Super Page Cache manages it automatically and overwrites manual changes the next time you save your settings.

Regenerate the rule if it is missing

  1. In WordPress Admin → Super Page Cache → Settings → Cloudflare Integration, confirm the correct Zone is selected for this site.
  2. Confirm Enable Cloudflare CDN & Caching is turned on, then click Save Changes.
  3. If the rule still does not appear, turn Enable Cloudflare CDN & Caching off and click Save Changes, then turn it back on and click Save Changes again. This forces the plugin to recreate the rule.
  4. Purge the plugin cache and the Cloudflare cache, then re-check your response headers for CF-Cache-Status: HIT.

If the rule is still missing, the API token most likely lacks the permissions needed to create it. Recreate the token with the Zone / Cache Rules: Edit and Zone / Transform Rules: Edit permissions described in Super Page Cache Cloudflare Permissions, reconnect, and save again. If you have enabled Log Mode under Super Page Cache → Advanced → Logs Settings, the plugin log records Cloudflare API write errors that confirm a permission problem.

⚠️ Important: You do not need to create a Cloudflare Cache Rule by hand. Let Super Page Cache create and manage its own rule. A rule you add manually is separate from the plugin-managed rule and is not maintained by the plugin. For the specific case where Cloudflare-injected cookies prevent caching, see Troubleshooting "Cloudflare integration has an issue".

Monitoring and Maintenance

Key Metrics to Monitor

Cloudflare Analytics:

  • Cache hit ratio (target: >85%)
  • Bandwidth savings
  • Page load time improvements
  • Security threat blocks

Super Page Cache Analytics:

  • Server cache hit ratio
  • Cache file generation rate
  • Storage usage
  • Performance improvements

Congratulations! You've successfully integrated Cloudflare with Super Page Cache. Your website should now benefit from global edge caching combined with optimized server-side caching, resulting in significantly improved performance for visitors worldwide.

Monitor your analytics regularly and fine-tune settings based on your specific traffic patterns and performance goals.

Was this helpful?