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

wpcanyon.com

Tag: BunnyCDN

BunnyCDN setup for WordPress (origin shield & query‑string cache)

Posted on August 19, 2025 By Admin No Comments on BunnyCDN setup for WordPress (origin shield & query‑string cache)

BunnyCDN Setup for WordPress (Origin Shield & Query-String Cache)

If you want to speed up your WordPress site globally and reduce server load, BunnyCDN is a reliable, cost-effective CDN solution. However, configuring BunnyCDN properly—especially with origin shield and query-string caching—can be tricky. This guide provides a quick fix and detailed steps to set up BunnyCDN with WordPress, ensuring optimal caching behavior and improved site performance.

Quick Fix: BunnyCDN WordPress Setup with Origin Shield & Query-String Cache

  1. Create a BunnyCDN Pull Zone pointing to your WordPress origin server.
  2. Enable Origin Shield in BunnyCDN dashboard to reduce origin hits.
  3. Configure BunnyCDN to cache query-string parameters correctly.
  4. Set appropriate cache-control headers in WordPress (via .htaccess or functions.php).
  5. Update your WordPress URLs to use the BunnyCDN Pull Zone URL.
  6. Test caching behavior and purge cache when necessary.

Why This Happens

WordPress sites often serve dynamic content with query strings (e.g., ?product_id=123), which many CDNs do not cache by default or cache incorrectly. Without proper query-string caching, users may get stale or incorrect content. Additionally, frequent origin requests can overload your server, especially during traffic spikes.

BunnyCDN’s Origin Shield acts as an additional caching layer between your origin and the CDN edge nodes, reducing origin load. Properly configuring query-string caching ensures that BunnyCDN caches unique versions of pages based on query parameters, improving cache hit ratio and user experience.

Requirements

  • Active BunnyCDN account
  • WordPress site with admin access
  • Access to your web server configuration (Apache, Nginx, or via cPanel/Plesk)
  • Basic knowledge of editing WordPress theme files or .htaccess

Step-by-step BunnyCDN WordPress Setup

1. Create a BunnyCDN Pull Zone

  1. Log in to your BunnyCDN dashboard.
  2. Go to Pull Zones and click Add Pull Zone.
  3. Enter a name (e.g., mywpsite), and set your WordPress site URL as the origin URL.
  4. Click Add Pull Zone and wait for the zone to be created.

2. Enable Origin Shield

  1. In your Pull Zone settings, navigate to the Origin Shield tab.
  2. Enable Origin Shield and select the closest region to your origin server.
  3. Save changes.

3. Configure Query-String Caching

  1. Go to the Cache tab in your Pull Zone settings.
  2. Under Query String Caching, select Cache every unique URL.
  3. Optionally, specify which query parameters to include or exclude.
  4. Save changes.

4. Set Cache-Control Headers in WordPress

To ensure BunnyCDN caches your content correctly, set proper cache-control headers. You can do this via .htaccess (Apache) or via WordPress functions.

Apache (.htaccess) example:

# BEGIN BunnyCDN Cache-Control
<IfModule mod_expires.c>
  ExpiresActive On
  ExpiresByType text/html "access plus 1 hour"
  ExpiresByType image/jpeg "access plus 1 month"
  ExpiresByType image/png "access plus 1 month"
  ExpiresByType text/css "access plus 1 week"
  ExpiresByType application/javascript "access plus 1 week"
</IfModule>

<IfModule mod_headers.c>
  Header set Cache-Control "public, max-age=3600"
</IfModule>
# END BunnyCDN Cache-Control

WordPress functions.php example:

function add_cache_control_headers() {
    if (is_admin()) return;
    header('Cache-Control: public, max-age=3600');
}
add_action('send_headers', 'add_cache_control_headers');

5. Replace URLs in WordPress to Use BunnyCDN

Update your WordPress URLs to serve static assets (images, CSS, JS) via BunnyCDN.

  • Use a plugin like Better Search Replace to replace URLs in your database from https://yourdomain.com/wp-content/ to https://yourpullzone.b-cdn.net/wp-content/.
  • Alternatively, use the WP Rocket or W3 Total Cache plugins to rewrite URLs for static files.

6. Test and Purge Cache

  1. Visit your site and inspect network requests to verify assets load from BunnyCDN URL.
  2. Use BunnyCDN’s cache control headers checker or browser dev tools to confirm caching.
  3. If you update content, purge BunnyCDN cache from the dashboard or via API.

Common Pitfalls

  • Not enabling query-string caching: Dynamic pages may serve stale or incorrect content.
  • Incorrect cache-control headers: BunnyCDN may not cache content or cache it too long.
  • Forgetting to update URLs: Static assets won’t load from BunnyCDN, missing performance benefits.
  • Origin Shield region mismatch: Selecting a distant region can increase latency.
  • Plugin conflicts: Some caching or security plugins may interfere with headers or CDN URLs.

Works on

Environment Notes
Apache Supports .htaccess cache headers and URL rewrites.
Nginx Requires manual config for cache-control headers; BunnyCDN works seamlessly.
LiteSpeed Compatible with .htaccess and cache headers.
cPanel / P
…
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