ProRank SEO
Docs/Performance/Caching & CDN

Caching & CDN

Optimize your WordPress site with local caching and global CDN distribution

Real Architecture

This documentation reflects the actual implementation: Your WordPress site runs on a single origin server. CDN providers (Cloudflare, BunnyCDN) handle global distribution. No misleading claims about multiple servers.

How It Actually Works

1. Origin Server: Your WordPress hosting server (single location)

2. CDN Provider: Cloudflare (275 locations), BunnyCDN (123 locations), or KeyCDN (34 locations)

3. Global Visitors: Served from nearest CDN edge location

Core Features

Local Server Caching

  • Page cache on your origin server
  • Redis integration for cache stats
  • Automatic cache invalidation on updates
  • Cache preloading via WP-Cron

CDN Integration

  • Cloudflare API integration
  • BunnyCDN purge API
  • Automatic CDN cache purging
  • Admin bar quick purge button

CSS Optimization

  • CSS minification
  • Combine CSS files
  • Inline @import statements
  • Cache external CSS locally
  • Font-display optimization

JavaScript Optimization

  • Defer JavaScript loading
  • Delay until user interaction (Beta)
  • Exclude critical scripts

Configuration Guide

1. Local Cache Settings

WordPress Adminphp
// Navigate to: ProRank SEO > Performance > Caching & CDN

// General Tab Settings:
- Enable Page Cache: ON
- Cache Lifetime: 3600 seconds
- Exclude URLs: /checkout/, /cart/, /my-account/
- Cache Mobile Separately: OFF (unless needed)

2. CDN Provider Setup

CDN Configurationphp
// Cloudflare (Recommended - Free tier available)
CDN Provider: Cloudflare
Zone ID: [Found in Cloudflare dashboard]
API Token: [Create with Cache Purge permission]

// BunnyCDN (Budget-friendly - $0.01/GB)
CDN Provider: BunnyCDN  
Pull Zone ID: [From BunnyCDN panel]
API Key: [Account API key]

// No CDN
CDN Provider: None
Note: Content served only from origin server

3. Preloading Configuration

Cache Preloadingphp
// Preload Tab Settings:
- Enable Cache Preloading: ON
- Preload Mode: Sitemap (recommended)
- Schedule: Daily
- Auto-preload on Save: ON

// What it does:
// - Visits pages to warm LOCAL server cache
// - Does NOT warm CDN caches globally
// - CDN caches warm naturally as visitors access

4. Advanced Optimizations

CSS/JS Settingsphp
// CSS Optimization:
- Minify CSS: ON
- Combine CSS Files: ON (test first)
- Inline @import: ON
- Cache External CSS: ON
- Font Display Swap: ON
- CSS Cache Lifetime: 30 days

// JavaScript Optimization:
- Defer JavaScript: ON
- Delay Execution: OFF (Beta - may break)
- Exclude Scripts: jquery.min.js, critical.js

REST API Endpoints

Cache Statistics

GET /wp-json/prorank-seo/v1/cache/stats
{
  "hit_rate": 85.5,
  "total_cached": 150,
  "cache_size": "45.2 MB",
  "bandwidth_saved": "1.2 GB",
  "cdn_status": "Active",
  "edge_locations": 275
}

Clear Cache

POST /wp-json/prorank-seo/v1/cache/clear

Clears local and CDN cache

CSS Cache Management

POST /wp-json/prorank-seo/v1/performance/css-cache/clear

Parameters: type (all|minified|external)

Test CSS Optimization

POST /wp-json/prorank-seo/v1/performance/css-test

Tests optimization on homepage

WP-CLI Commands

# Clear all cache (local + CDN)
wp prorank cache clear

# Clear specific URL
wp prorank cache clear --url="https://example.com/page"

# Get cache statistics
wp prorank cache stats

# Preload cache (warms local server only)
wp prorank cache preload

# Clear CDN cache only
wp prorank cache clear-cdn

# Test CSS optimization
wp prorank css test

# Clear CSS cache
wp prorank css clear-cache

Real Performance Impact

With CDN (e.g., Cloudflare)

  • ✅ Content served from 275 global locations
  • ✅ ~80% bandwidth savings on origin
  • ✅ <50ms latency for most visitors
  • ✅ DDoS protection included
  • ✅ Automatic image optimization

Without CDN

  • ⚠️ Content from single server location
  • ⚠️ Higher bandwidth costs
  • ⚠️ Distance-based latency (100-500ms)
  • ⚠️ No DDoS protection
  • ⚠️ Manual optimization required

Recommendation

Start with Cloudflare's free tier. It provides 275 edge locations, DDoS protection, and automatic optimizations at no cost. This is the simplest way to achieve "multi-region" content delivery.

Common Issues & Solutions

Cache Not Clearing

CDN cache may persist after clearing local cache.

Solution: Use admin bar "Clear CDN Cache" or configure CDN API credentials.

CSS Changes Not Showing

Minified CSS cached for 30 days by default.

Solution: Clear CSS cache from Advanced tab or reduce cache lifetime.

JavaScript Errors

Delay execution can break interactive elements.

Solution: Exclude critical scripts or disable delay execution.

Logged-in Users See Cached Content

Cache serving to authenticated users.

Solution: Add login cookies to exclude list.

Beta Features

Enable with Caution

Beta features are experimental and may cause issues. Test thoroughly on staging first.

Service Worker (Beta)

Offline caching and predictive preloading in browser.

Status: Testing phase - not production ready

Cloudflare Workers (Beta)

Edge computing for dynamic optimization.

Status: Requires Cloudflare Pro plan

WebSocket Monitoring (Beta)

Real-time cache statistics updates.

Status: Available with ProRank.io integration

Understanding the Architecture

What you have: One WordPress server (your hosting) that can integrate with CDN services.

What CDN provides: Global content distribution from edge locations (not your servers).

What caching does: Reduces server processing time and bandwidth usage.

What preloading does: Warms your local server cache, not CDN edges.

This plugin optimizes your single server and integrates with CDN providers for global reach. We don't create multiple servers or fake infrastructure.

Next Steps