Skip to content
  • Quick Ref
  • Contact
  • About
wpcanyon.com

wpcanyon.com

Tag: Cloudflare

Cloudflare cache rules for WordPress (no admin caching)

Posted on August 19, 2025 By Admin No Comments on Cloudflare cache rules for WordPress (no admin caching)

Cloudflare Cache Rules for WordPress (No Admin Caching)

If you use Cloudflare with your WordPress site, you might notice issues when the WordPress admin dashboard or login pages get cached. This can cause outdated content, login problems, or broken admin functionality. The quick fix is to set up Cloudflare cache rules that exclude the WordPress admin area and login pages from caching, ensuring smooth backend operations while still benefiting from caching on the public site.

Quick Fix

  1. Log in to your Cloudflare dashboard.
  2. Navigate to the “Rules” section and select “Page Rules” or “Cache Rules” (depending on your Cloudflare plan).
  3. Create rules to bypass cache for URLs related to WordPress admin and login:
    • example.com/wp-admin/*
    • example.com/wp-login.php*
  4. Set these rules to Bypass Cache or Cache Level: Bypass.
  5. Save and deploy the rules.
  6. Test by logging in and accessing the admin dashboard to confirm no caching issues.

Why This Happens

Cloudflare caches static content by default to speed up your website. However, WordPress admin pages and login screens are dynamic and personalized. If Cloudflare caches these pages, users may see stale content or be unable to log in properly. This happens because Cloudflare does not differentiate between public and admin URLs unless explicitly told to do so. Therefore, you need to create cache rules that exclude admin and login URLs from caching.

Requirements

  • A Cloudflare account with your WordPress site added.
  • Access to the Cloudflare dashboard to create cache or page rules.
  • Basic understanding of WordPress URL structure.

Step-by-Step: Setting Up Cloudflare Cache Rules for WordPress Admin

  1. Log in to Cloudflare at https://dash.cloudflare.com.
  2. Select your domain from the list.
  3. Go to the “Rules” tab in the dashboard sidebar.
  4. Create a new Page Rule or Cache Rule (depending on your Cloudflare plan):
    • Click Create Page Rule or Create Cache Rule.
  5. Enter the URL pattern for the WordPress admin area:
  6. https://example.com/wp-admin/*
  7. Set the rule action to: Cache Level: Bypass or Bypass Cache.
  8. Save and deploy the rule.
  9. Create a second rule for the login page:
  10. https://example.com/wp-login.php*
  11. Set the same bypass cache action.
  12. Save and deploy.
  13. Optional: Add rules to bypass caching for REST API and AJAX calls:
  14. https://example.com/wp-json/*
    https://example.com/admin-ajax.php*
  15. Test your site: Log in and navigate the admin dashboard to confirm no caching issues.

Code Snippets for Cloudflare Cache Rules

Here are the exact URL patterns to use when creating your Cloudflare rules:

URL Pattern Cache Action Purpose
https://example.com/wp-admin/* Bypass Cache Exclude WordPress admin pages
https://example.com/wp-login.php* Bypass Cache Exclude login page
https://example.com/wp-json/* Bypass Cache Exclude REST API requests
https://example.com/admin-ajax.php* Bypass Cache Exclude AJAX requests

Note: Replace example.com with your actual domain.

Common Pitfalls

  • Not using HTTPS in URL patterns: Cloudflare rules are protocol-specific. Use https:// if your site uses SSL.
  • Incorrect wildcard usage: Use * to match any characters after the path. For example, /wp-admin/* matches all admin subpages.
  • Rule order matters: Cloudflare processes rules in order. Place bypass rules above any general caching rules.
  • Forgetting REST API and AJAX: These endpoints are critical for admin functionality and should also be excluded from caching.
  • Not clearing Cloudflare cache after changes: Purge cache to ensure new rules take effect immediately.

Works On

  • Cloudflare CDN (all plans with Page Rules or Cache Rules support)
  • WordPress sites on Apache, Nginx, LiteSpeed, or other web servers
  • Hosting control panels like cPanel, Plesk, or custom setups

FAQ

Q: Can I cache the WordPress admin area safely?
A: No, caching the admin area can cause outdated content and login issues. Always bypass cache for admin URLs.
Q: What happens if I don’t exclude wp-login.php from caching?
You may experience login failures or see cached login pages that prevent proper authentication.
Q: Do I need to exclude REST API and AJAX URLs?
Yes, these endpoints are essential for dynamic admin functions and should not be cached.
Q: How do I clear Cloudflare cache after adding rules?
Go to the “Caching” tab in Cloudflare dashboard and click “
…
Speed & Security

BunnyCDN + Cloudflare: should you double‑up and how to do it

Posted on August 19, 2025 By Admin No Comments on BunnyCDN + Cloudflare: should you double‑up and how to do it

BunnyCDN + Cloudflare: Should You Double‑Up and How to Do It

Using BunnyCDN and Cloudflare together can supercharge your WordPress site’s speed and security. But is it necessary to stack these two CDNs, and if so, how do you configure them correctly without causing conflicts? This guide explains when combining BunnyCDN and Cloudflare makes sense and provides a clear, step-by-step setup to get you started.

Quick Fix: How to Use BunnyCDN and Cloudflare Together on WordPress

  1. Set up Cloudflare as your DNS and primary CDN with your domain pointing to your origin server.
  2. Create a Pull Zone in BunnyCDN targeting your Cloudflare URL or origin server.
  3. Configure BunnyCDN as a secondary CDN by rewriting static asset URLs to BunnyCDN URLs in WordPress.
  4. Adjust cache settings on both BunnyCDN and Cloudflare to avoid cache conflicts.
  5. Test your site to ensure assets load correctly and caching behaves as expected.

Why This Happens: Understanding the Need for BunnyCDN and Cloudflare Together

Cloudflare is a popular CDN and security provider that offers global caching, DDoS protection, and SSL termination. BunnyCDN is a fast, affordable CDN focused on delivering static assets with low latency. Using both together can:

  • Improve global performance: Cloudflare caches your entire site at the edge, while BunnyCDN can serve static assets from a highly optimized network.
  • Enhance security: Cloudflare protects your origin from attacks and bots.
  • Optimize costs: BunnyCDN’s pay-as-you-go pricing for bandwidth can reduce costs for heavy static asset delivery.

However, stacking two CDNs can cause caching conflicts, increased complexity, and potential delays if not configured properly. This is why a clear architecture and cache strategy is essential.

Architecture Options: How to Combine BunnyCDN and Cloudflare

There are two common architectures when combining BunnyCDN and Cloudflare:

Architecture Description Pros Cons
Cloudflare as Primary CDN + BunnyCDN as Secondary CDN Cloudflare proxies all traffic, BunnyCDN serves static assets (images, CSS, JS) via rewritten URLs. Best security, flexible static asset delivery, easy to control cache separately. Requires URL rewriting and cache rule management.
BunnyCDN as Primary CDN + Cloudflare as DNS + Security BunnyCDN pulls from origin; Cloudflare handles DNS and security but does not proxy content. Simpler CDN setup, Cloudflare security benefits. Less caching at Cloudflare edge, possible slower dynamic content.

The most common and recommended setup is Cloudflare as primary CDN with BunnyCDN serving static assets separately.

Step-by-Step: Setting Up BunnyCDN and Cloudflare Together on WordPress

  1. Configure Cloudflare for Your Domain
    1. Sign up or log in to Cloudflare.
    2. Add your domain and update your nameservers to Cloudflare’s.
    3. Enable proxy (orange cloud) for your domain in DNS settings.
    4. Configure SSL (Full or Full Strict) and security settings.
    5. Enable caching and performance features as needed.
    
  2. Create a BunnyCDN Pull Zone
    1. Log in to BunnyCDN dashboard.
    2. Go to 'Pull Zones' and create a new zone.
    3. Set the origin URL to your Cloudflare proxied domain (e.g., https://www.yoursite.com).
    4. Choose the closest storage region.
    5. Save the Pull Zone and note the BunnyCDN URL (e.g., yourzone.b-cdn.net).
    
  3. Rewrite Static Asset URLs in WordPress

    Use a plugin or code snippet to rewrite URLs for images, CSS, and JS to BunnyCDN URLs.

    <?php
    function replace_static_urls_with_bunnycdn($content) {
        $bunnycdn_url = 'https://yourzone.b-cdn.net';
        $site_url = get_site_url();
        $content = str_replace($site_url . '/wp-content/uploads', $bunnycdn_url . '/wp-content/uploads', $content);
        $content = str_replace($site_url . '/wp-includes', $bunnycdn_url . '/wp-includes', $content);
        $content = str_replace($site_url . '/wp-content/themes', $bunnycdn_url . '/wp-content/themes', $content);
        return $content;
    }
    add_filter('the_content', 'replace_static_urls_with_bunnycdn');
    add_filter('style_loader_src', function($src) use ($bunnycdn_url, $site_url) {
        return str_replace($site_url, $bunnycdn_url, $src);
    });
    add_filter('script_loader_src', function($src) use ($bunnycdn_url, $site_url) {
        return str_replace($site_url, $bunnycdn_url, $src);
    });
    ?>
    

    Alternatively, use plugins like CDN Enabler to rewrite URLs easily.

  4. Configure Cache Settings on Cloudflare and BunnyCDN
    • On Cloudflare, set caching level to “Standard” or “Aggressive” but exclude static assets served by BunnyCDN if possible.
    • On BunnyCDN, set appropriate cache expiration headers (e.g., 1 week for images, CSS, JS).
    • Use page rules in Cloudflare to bypass cache for dynamic content or admin pages.
  5. Test Your Setup
    1. Clear all caches (WordPress, BunnyCDN, Cloudflare).
    2. Load your site and inspect asset URLs to confirm they use BunnyCDN URLs.
    3. Use browser dev tools to check response headers for caching.
    4. Verify SSL works correctly and site loads fast globally.
    

Cache Rules: Best Practices for BunnyCDN and Cloudflare

  • Cloudflare: Use page rules to bypass cache on wp-admin, login pages, and dynamic endpoints.
  • BunnyCDN: Cache static assets aggressively with long TTL
…
Speed & Security

BunnyCDN vs Cloudflare for WordPress (which is best for you?)

Posted on August 18, 2025August 19, 2025 By Admin No Comments on BunnyCDN vs Cloudflare for WordPress (which is best for you?)

BunnyCDN vs Cloudflare for WordPress (which is best for you?)

If you run a WordPress website, improving your site’s speed and security is crucial. Content Delivery Networks (CDNs) like BunnyCDN and Cloudflare are popular choices to help with this. But which one is better for your WordPress site? This article compares BunnyCDN and Cloudflare to help you decide which fits your needs best.

Quick Answer

Both BunnyCDN and Cloudflare offer excellent CDN services, but they serve slightly different purposes and audiences:

  • BunnyCDN is a straightforward, easy-to-use CDN focused on fast content delivery with simple pricing, ideal for WordPress users who want a dedicated CDN without extra features.
  • Cloudflare is a comprehensive platform combining CDN, security, DNS, and performance optimization, suitable for users who want an all-in-one solution with advanced security features.

Your choice depends on whether you prioritize simplicity and cost (BunnyCDN) or a broader feature set including security and DNS management (Cloudflare).

Feature-by-Feature Comparison

Feature BunnyCDN Cloudflare
CDN Network 60+ PoPs worldwide, optimized for fast static content delivery 250+ PoPs globally, extensive network with dynamic content acceleration
Ease of Setup Simple setup with WordPress plugins and manual integration Easy setup with WordPress plugin and automatic DNS integration
Security Features Basic SSL support, token authentication, DDoS protection (limited) Advanced security: WAF, DDoS protection, SSL, bot management
Performance Optimization HTTP/2, Brotli compression, cache control, image optimization (paid add-on) HTTP/2 & HTTP/3, Brotli, automatic image optimization, Rocket Loader
Pricing Model Pay-as-you-go, low per-GB rates, no monthly fees Free tier available, paid plans with fixed monthly fees
Additional Features Pull zones, storage, video delivery, real-time analytics DNS management, SSL, firewall, Workers (serverless functions)
Support Email and ticket support, knowledge base 24/7 support on paid plans, community forums, extensive docs

Pricing

BunnyCDN:

  • Pricing is based on bandwidth usage, starting at $0.01/GB in North America and Europe.
  • No monthly minimums or fixed fees.
  • Additional features like storage and video delivery have separate pricing.

Cloudflare:

  • Free plan available with basic CDN and security features.
  • Pro plan at $20/month adds WAF, image optimization, and more.
  • Business and Enterprise plans offer advanced features and support at higher prices.

Use Cases

  • Choose BunnyCDN if:
    • You want a simple, cost-effective CDN focused on speeding up static assets.
    • You prefer pay-as-you-go pricing without monthly commitments.
    • Your site does not require advanced security or DNS management features.
  • Choose Cloudflare if:
    • You want an all-in-one platform combining CDN, security, DNS, and performance tools.
    • You need advanced security features like WAF and bot management.
    • You prefer a free tier to start with and scale up as needed.

Why This Comparison Matters

WordPress sites often suffer from slow loading times and security vulnerabilities. Choosing the right CDN can significantly improve user experience and protect your site. BunnyCDN and Cloudflare both offer CDN services but differ in scope, pricing, and features, making it essential to understand which aligns with your WordPress site’s goals.

Step-by-Step: How to Integrate BunnyCDN or Cloudflare with WordPress

Integrate BunnyCDN with WordPress

  1. Sign up for a BunnyCDN account at bunnycdn.com.
  2. Create a Pull Zone in the BunnyCDN dashboard and note the CDN URL.
  3. Install and activate the WP Rocket plugin or a similar caching plugin that supports CDN integration.
  4. In the plugin settings, enter the BunnyCDN Pull Zone URL as your CDN URL.
  5. Save changes and clear your WordPress cache.
  6. Verify that your static assets (images, CSS, JS) are loading from the BunnyCDN URL.

Integrate Cloudflare with WordPress

  1. Sign up for a Cloudflare account at cloudflare.com.
  2. Add your domain to Cloudflare and follow the steps to change your DNS nameservers to Cloudflare’s.
  3. Install and activate the official Cloudflare WordPress plugin.
  4. Connect the plugin to your Cloudflare account using your API key.
  5. Configure settings like automatic cache purging and security options in the plugin.
  6. Enable Cloudflare features such as SSL, WAF, and performance optimizations from the Cloudflare dashboard.

Works on

  • Both BunnyCDN and Cloudflare work with WordPress on Apache, Nginx, LiteSpeed, and other web servers.
  • Compatible with hosting control panels like cPanel, Plesk, and managed WordPress hosts.
  • Integration requires DNS changes for Cloudflare; BunnyCDN works without DNS changes.

FAQ

dl…
Comparisons

Recent Posts

  • Top WordPress Themes for Blogs in 2025
  • WordPress Admin Panel Trick: Adding ID Field to the Posts Listing
  • Solution previous_posts_link and next_posts_link Not Working
  • Show Top Commentators in WordPress Without a Plugin
  • How to Style Admin Comments in WordPress

Recent Comments

    Archives

    • August 2025

    Categories

    • Admin & Blocks
    • Admin & UI
    • Automation
    • Automation & Plugins
    • Comments
    • Comparisons
    • Database & Revisions
    • Developer Snippets
    • Fixes & Errors
    • Media & Thumbnails
    • Queries & Pagination
    • Security
    • Speed & Security
    • Tips & Tricks
    • WooCommerce How‑tos
    • WordPress Snippets
    • WordPress Themes
    • Terms & Conditions
    • Affiliate Disclosure

    Copyright © 2025 wpcanyon.com.

    Powered by PressBook WordPress theme

    Also by the maker of MySurveyReviews.com