Configure Caching Settings

10 min read
Last updated: Oct 24, 2024

Caching is one of the most effective ways to improve your WordPress site's performance. The Wp Admin caching engine automatically creates static HTML versions of your dynamic pages, reducing server load and dramatically improving page load times.

Note: Caching settings are applied globally to your site. For multi-site networks, you can configure settings per site by visiting the site-specific settings page.

Configuration Panel

Access the caching configuration panel to manage all caching-related settings. The following panel represents the current state of your caching configuration.

Caching Configuration
Cache Active
Enable Page Caching
Generate static HTML files for faster delivery
Enable Browser Caching
Set cache-control headers for static resources
Enable Cache Preloading
Automatically preload cache for sitemaps and popular pages
Cache Exclusion Rules
Exclude specific pages or patterns from caching
One pattern per line. Supports wildcards and query strings.

Understanding Cache Modes

Wp Admin offers three cache modes to balance performance and dynamic content handling:

  • Aggressive: Maximum performance. Caches all pages including those with dynamic widgets. Best for content-heavy sites.
  • Moderate: Balanced approach. Excludes pages with certain dynamic elements while caching most content.
  • Light: Minimal caching. Only caches static resources and simple pages. Best for highly dynamic applications.
Warning: Aggressive mode may not be suitable for sites with user-specific content or e-commerce checkout flows. Ensure exclusion rules are properly configured.

Cache Preloading

When enabled, Wp Admin will automatically preload cached versions of your pages based on your sitemap and recent traffic patterns. This ensures that your cache is always warm and visitors get instant responses.

Preloading Schedule

You can configure the preloading frequency in the advanced settings:

wp-config.php
// Wp Admin Cache Preloading Configuration
define('WP_ADMIN_CACHE_PRELOAD', true);
define('WP_ADMIN_PRELOAD_SCHEDULE', 'hourly');
define('WP_ADMIN_PRELOAD_PRIORITY', 'high');

// Advanced: Custom preload patterns
define('WP_ADMIN_PRELOAD_PATTERNS', array(
    'posts',
    'pages',
    'custom-post-types',
    '/product/*'
));

Troubleshooting

If you're experiencing issues with caching, try the following steps:

  1. Purge all cache: Click the "Purge All Cache" button in the configuration panel.
  2. Check exclusion rules: Ensure your dynamic pages are properly excluded.
  3. Verify file permissions: Wp Admin requires write access to the cache directory.
  4. Clear object cache: If using Redis or Memcached, flush the object cache.
SSH Command
# Clear all Wp Admin cache via CLI
wp cache flush

# Regenerate sitemap and preload cache
wp wpadmin cache preload --sitemap

# Check cache status
wp wpadmin cache status

API Reference

Programmatic cache management is available via the Wp Admin REST API:

cURL Example
# Purge cache for a specific URL
curl -X POST "https://api.wpadmin.com/v1/cache/purge" \n  -H "Authorization: Bearer YOUR_API_KEY" \n  -H "Content-Type: application/json" \n  -d '{
    "url": "https://example.com/page-to-purge",
    "pattern": false
  }'

# Get cache statistics
curl -X GET "https://api.wpadmin.com/v1/cache/stats" \n  -H "Authorization: Bearer YOUR_API_KEY"
Related Articles
CDN Integration Guide
Learn how to connect Cloudflare or BunnyCDN
Minify CSS & JavaScript
Optimize assets for faster delivery
Database Optimization
Clean and optimize your WordPress database