Installation & Quick Start
Get MilliCache installed and caching your WordPress site in 5 minutes.
Requirements#Copied!
| Component | Requirement |
|---|---|
| PHP | 7.4 or higher |
| WordPress | 5.6 or higher |
| Storage | Redis, ValKey, Dragonfly, or KeyDB server |
ext-zlib PHP extension enables gzip compression of cached content, reducing memory usage significantly.Installation Methods#Copied!
Method 1: GitHub Release (Recommended)#Copied!
- Download the latest release from GitHub Releases
- Upload the ZIP file via Plugins → Add New → Upload Plugin
- Activate the plugin
The release package includes all dependencies pre-bundled and prefixed to avoid conflicts.
When activated, MilliCache automatically creates the advanced-cache.php drop-in file required for early request interception.
Method 2: Composer#Copied!
For developers managing WordPress with Composer:
1composer require millipress/millicache
Dependencies (predis/predis and millipress/millirules) are automatically installed and prefixed.
Setup (2 Steps)#Copied!
Step 1: Enable WP_CACHE#Copied!
Add to your wp-config.php before the "That's all, stop editing!" line:
1define( 'WP_CACHE', true );
WP_CACHE constant must be set to true for MilliCache to intercept requests early in the WordPress bootstrap process. Without this, caching will not work.Step 2: Configure Redis Connection (If Needed)#Copied!
By default, MilliCache connects to Redis at 127.0.0.1:6379. If your Redis server uses different settings:
Option A: Via Admin UI
Go to Settings → MilliCache → Settings Tab → Storage Server and enter your Redis credentials.
Option B: Via wp-config.php
1define( 'MC_STORAGE_HOST', '127.0.0.1' );
2define( 'MC_STORAGE_PORT', 6379 );
3define( 'MC_STORAGE_PASSWORD', 'your-redis-password' );
4define( 'MC_STORAGE_DB', 0 );
Settings defined as constants override those in the admin UI.
Verify It's Working#Copied!
Via Admin UI#Copied!
Navigate to Settings → MilliCache → Stats Tab to see:
- Cache entries count
- Total cache size
- Cache hit ratio
- Recent cache activity
You can also check the admin bar: MilliCache should show cache statistics.
Via Browser (Easiest)#Copied!
-
Enable debug headers in
wp-config.php:1define( 'MC_CACHE_DEBUG', true ); -
Visit your homepage (logged out)
-
Open browser developer tools (F12) → Network tab
-
Refresh the page and check the response headers:
Header First Visit Second Visit X-MilliCache-StatusmisshitX-MilliCache-Flagsnot set Shows assigned flags X-MilliCache-Expiresnot set Seconds until expiry Success: Second visit shows
X-MilliCache-Status: hit✓
MC_CACHE_DEBUG) must be enabled for the extension to display cache information.Via WP-CLI (Optional)#Copied!
If you have WP-CLI installed, you can run comprehensive tests:
Check status:
1wp millicache status
Expected output:
+-------------------+------------------+
| property | status |
+-------------------+------------------+
| plugin_version | 1.0.0 |
| wp_cache | enabled |
| advanced_cache | symlink |
| storage_connected | yes |
| storage_version | 7.2.4 |
| cache_entries | 1 |
| cache_size | 15 KB |
+-------------------+------------------+
Test Redis connection:
1wp millicache test
This performs connection, ping, write, read, and delete tests. All should show PASS.
View cache statistics:
1wp millicache stats
That's It!#Copied!
Your site is now caching. Here's what happens automatically by default:
- Anonymous visitors receive cached pages (fast!)
- Logged-in users bypass the cache (personalized content)
- Content updates automatically clear related cache entries
- Expired cache serves stale content while regenerating (grace period)
Default Behavior#Copied!
Out of the box, MilliCache:
| Setting | Default | Meaning |
|---|---|---|
| TTL | 1 day | Cache expires after 24 hours |
| Grace | 1 month | Stale cache served while regenerating |
| Gzip | Enabled | Compressed storage saves memory |
| Logged-in users | Bypassed | No caching for authenticated users |
| POST requests | Bypassed | Only GET/HEAD requests cached |
| Admin/REST/AJAX | Bypassed | Backend requests never cached |
Common Tasks#Copied!
Clear All Cache#Copied!
Via Admin Bar: MilliCache → Clear Site Cache
Via Admin UI: Settings → MilliCache → Stats Tab → Clear Cache Button
Via WP-CLI (optional):
1wp millicache clear
Clear Specific Post#Copied!
Via Admin Bar: When viewing a post, click MilliCache → Clear Post Cache
Via WP-CLI (optional):
1wp millicache clear --id=123
View Configuration#Copied!
Via Admin UI: Settings → MilliCache → Settings Tab
Via WP-CLI (optional):
1wp millicache config get
Troubleshooting#Copied!
advanced-cache.php Issues#Copied!
The drop-in is created automatically on activation. If it needs repair (e.g., after deployment or manual deletion):
Via WP-CLI:
1wp millicache drop --force
advanced-cache.php, you must deactivate that plugin first.Permission Issues#Copied!
The wp-content/settings directory must be writable by the web server user.
Redis Connection Failed#Copied!
- Verify Redis is running:
redis-cli ping(should returnPONG) - Check connection settings in Settings → MilliCache → Settings Tab → Storage Server
- Test connectivity via Settings → MilliCache → Stats Tab or
wp millicache test
WP_CACHE Not Enabled#Copied!
Check Settings → MilliCache for warnings. Ensure define( 'WP_CACHE', true ); is in wp-config.php before the "That's all" line.
No Cache Headers Showing#Copied!
Make sure you're:
- Logged out (logged-in users bypass cache)
- Using a GET request (not POST)
- Not on an admin/login/REST/AJAX page
- Have
MC_CACHE_DEBUGset totrue
Multisite Installation#Copied!
For WordPress Multisite:
- Network-activate the plugin
- The
WP_CACHEconstant applies to all sites - Each site's cache is automatically isolated
- Network admins can clear cache for all sites via Network Admin → MilliCache
See Multisite for detailed configuration.
Next Steps#Copied!
- Configuration - Customize caching behavior
- Cache Clearing - Learn invalidation strategies
- WP-CLI Commands - Master command-line tools (optional)