Caching & CDN
Intelligent page caching and global content delivery network integration
Overview
ProRank SEO's Caching & CDN features provide enterprise-level performance optimization available to all users, including the Free tier. With intelligent page caching, browser caching rules, and seamless CDN integration, your WordPress site will load significantly faster from anywhere in the world.
Smart Caching
Intelligent page and object caching with automatic invalidation
CDN Ready
One-click integration with Cloudflare and other major CDNs
Zero Config
Works out of the box with optimal settings for most sites
Available in Free Tier
Page Caching
How It Works
Page caching stores fully rendered HTML pages, serving them instantly without PHP processing. This reduces server load and dramatically improves response times.
Automatic Features
- Cache preloading for popular pages
- Automatic cache clearing on content updates
- Mobile-specific cache variants
- Logged-in user exclusion
Smart Exclusions
- Shopping cart pages
- Checkout process
- User account areas
- Dynamic AJAX content
Configuration
// Enable ProRank Page Caching
define('PRORANK_CACHE_ENABLED', true);
// Cache lifetime (in seconds)
define('PRORANK_CACHE_TTL', 3600); // 1 hour
// Cache directory (optional, defaults to wp-content/cache)
define('PRORANK_CACHE_DIR', WP_CONTENT_DIR . '/cache/prorank');
// Exclude specific pages from caching
define('PRORANK_CACHE_EXCLUDE', [
'/cart/*',
'/checkout/*',
'/my-account/*',
'/wp-admin/*'
]);Browser Caching
Leverage Browser Cache
Automatically sets optimal cache headers for different file types, allowing browsers to store static resources locally and reduce server requests on repeat visits.
Default Cache Lifetimes
Static Assets
- Images (jpg, png, webp):1 year
- CSS Files:1 month
- JavaScript Files:1 month
- Fonts (woff, woff2):1 year
Dynamic Content
- HTML Pages:1 hour
- XML Sitemaps:24 hours
- RSS Feeds:1 hour
- API Responses:No cache
Cache Busting
CDN Integration
Global Content Delivery
Seamlessly integrate with major CDN providers to serve your content from edge locations worldwide, reducing latency and improving load times for global visitors.
Cloudflare
- • 275+ edge locations
- • Automatic purging
- • Free tier available
- • One-click setup
BunnyCDN
- • 100+ edge locations
- • Storage zones
- • Pay-as-you-go
- • API integration
Custom CDN
- • Any CDN provider
- • Custom URL rewriting
- • Pull zones support
- • Manual configuration
Cloudflare Setup
// Configure Cloudflare integration
add_filter('prorank_cdn_config', function($config) {
return [
'provider' => 'cloudflare',
'zone_id' => 'your-zone-id',
'api_token' => 'your-api-token',
'email' => 'your-email@example.com',
// Optional settings
'purge_on_update' => true,
'development_mode' => false,
'cache_level' => 'aggressive',
'browser_cache_ttl' => 14400,
'edge_cache_ttl' => 7200,
];
});Custom CDN Setup
// Configure custom CDN
add_filter('prorank_cdn_config', function($config) {
return [
'provider' => 'custom',
'cdn_url' => 'https://cdn.example.com',
// Asset types to serve from CDN
'include_types' => [
'css',
'js',
'images',
'fonts',
'videos'
],
// Exclude specific files
'exclude_files' => [
'critical.css',
'inline.js'
]
];
});Object Caching
Database Query Optimization
Object caching stores database query results in memory, dramatically reducing database load and improving dynamic content generation speed.
Supported Backends
- Redis (recommended)
- Memcached
- APCu
- File-based (fallback)
Cached Data
- WordPress options
- User meta data
- Transients
- Query results
// Enable Redis object caching
define('WP_REDIS_HOST', '127.0.0.1');
define('WP_REDIS_PORT', 6379);
define('WP_REDIS_DATABASE', 0);
// Optional: Set Redis password
define('WP_REDIS_PASSWORD', 'your-redis-password');
// Optional: Custom key prefix
define('WP_CACHE_KEY_SALT', 'prorank_');Cache Management
Intelligent Cache Purging
ProRank automatically manages cache invalidation to ensure content freshness while maintaining optimal performance.
Automatic Purging
- • Post/page updates clear related caches
- • Comment approval clears post cache
- • Theme switch clears all caches
- • Plugin activation/deactivation
- • Menu changes clear navigation cache
- • Widget updates clear sidebar cache
Manual Controls
- • Clear all caches button
- • Clear specific page cache
- • Clear CDN cache
- • Clear object cache
- • Preload cache manually
- • View cache statistics
Programmatic Cache Control
// Clear all caches
prorank_clear_all_caches();
// Clear specific page cache
prorank_clear_page_cache($post_id);
prorank_clear_url_cache('https://example.com/page');
// Clear CDN cache
prorank_purge_cdn_cache();
// Preload cache
prorank_preload_cache([
'https://example.com/',
'https://example.com/important-page'
]);
// Get cache statistics
$stats = prorank_get_cache_stats();
echo 'Cache hit rate: ' . $stats['hit_rate'] . '%';
echo 'Cached pages: ' . $stats['cached_pages'];
echo 'Cache size: ' . $stats['size_mb'] . ' MB';Performance Impact
Typical Improvements with Caching & CDN
70%
Faster TTFB
50%
Less Server Load
80%
Reduced Latency
90%
Static Hit Rate
Real-World Results
Troubleshooting
Cache not working?
- • Check if you're logged in (cache bypassed for admins)
- • Verify cache directory is writable
- • Check for conflicting cache plugins
- • Review excluded URLs in settings
- • Check .htaccess for caching rules
CDN not serving content?
Ensure your CDN is properly configured to pull from your origin server. Check DNS settings and verify the CDN can access your site. Use browser dev tools to check if assets are being served from CDN URLs.
Debug Mode
Enable debug mode to see cache headers and troubleshoot issues:
define('PRORANK_CACHE_DEBUG', true);
// Check response headers for X-ProRank-Cache status