Object Cache
The Object Cache module remembers the results of repeated database queries, so WordPress does not run them again on every request. This speeds up the admin and all uncached pages.
It ships MilliCache's own object-cache.php drop-in, backed by the same storage connection as the full-page cache. No second Redis configuration, no extra plugin: enable the toggle and the drop-in is installed.
Enable it under Settings → MilliCache → Modules → Object Cache (Caching group).
Why Pair It With the Page Cache#Copied!
The page cache makes cached pages fast; the object cache makes everything else faster:
- wp-admin, which the page cache never touches
- Cache misses, where WordPress has to render the page
- Logged-in users and other requests your rules bypass
Because it reuses the page cache's connection and storage server, it needs no setup of its own and is monitored together with the rest of MilliCache in the Status tab.
How It Works#Copied!
The drop-in is a two-tier cache:
- In-memory tier: values already read during the current request are served from PHP memory, exactly like WordPress core's built-in cache.
- Persistent tier: values survive across requests in your storage server, namespaced under their own key prefix so they never collide with page cache entries. Flushing the object cache never touches cached pages, and clearing the page cache never touches object cache data.
If the storage server is briefly unreachable, the drop-in degrades transparently to the in-memory tier instead of taking the site down. If the igbinary PHP extension is available, it is used automatically for faster, smaller serialization.
On multisite, keys are isolated per site, global groups are shared network-wide, and the module is managed from the Network Admin (the drop-in is one file for the whole install).
Playing Nice With Other Object Caches#Copied!
MilliCache never overwrites or removes a drop-in it does not own:
- If another
object-cache.phpis already installed, MilliCache works fine alongside it and the module stays off. You do not need to change anything. - To switch to the built-in object cache instead, remove the existing drop-in first; the toggle unlocks automatically.
- Disabling the module removes the drop-in again (only if it is MilliCache's own).
Requirements#Copied!
| Requirement | Why |
|---|---|
WP_CACHE set to true |
The page cache boots the storage connection the drop-in reuses. With WP_CACHE off, the object cache runs in-memory only and the Status tab tells you so. |
Writable wp-content |
The drop-in file is installed there |
| No foreign drop-in | MilliCache refuses to replace another plugin's object cache |
WP-CLI#Copied!
| Command | Description |
|---|---|
wp millicache object-cache status |
Show drop-in state and module setting |
wp millicache object-cache enable |
Install the drop-in and switch the module on |
wp millicache object-cache disable |
Switch the module off and remove the drop-in |
wp millicache object-cache flush |
Flush the object cache |
enable refuses to run while a foreign object-cache.php is installed, and disable leaves a foreign drop-in in place, matching the UI behavior.
Notes#Copied!
- The object cache implements the full modern WordPress cache API, including multi-key operations (
wp_cache_get_multipleand friends),wp_cache_flush_runtime, andwp_cache_flush_group. wp cache flush(andwp millicache object-cache flush) clears only object cache data, never cached pages.- A storage outage is logged to the PHP error log and handled gracefully; the site keeps running on the in-memory tier.
Next Steps#Copied!
- Storage Backends: the server both caches share
- High-Availability Connections: replication and Sentinel for the shared connection
Last updated: