Enabling Transient Caching
Improve filter speed and reduce server load using transient caching in Divi Machine. This feature temporarily stores filtered query results to reduce redundant database queries on repeated user actions.
How It Works
- When a user applies a filter (e.g., category, tag, custom field), the plugin first checks if a cached result (transient) exists.
- If yes, the cached results are used — no query to the database.
- If not, it processes the request and stores the results in the transient cache for the next request.
The cache is created using:
- Redis or Memcached, if available.
- Falls back to WordPress Object Cache (
WP_CACHE
) if neither is installed.
How to Enable Transient Caching
1. Ensure Server Compatibility
This feature requires:
- Redis or Memcached installed and active on the server, or
- WordPress object caching enabled with
define('WP_CACHE', true);
in yourwp-config.php
.
If neither is available, the plugin will alert you to enable caching.
2. Enable Caching in the Plugin Settings
- Go to
Divi Theme Options
>Divi Engine
. - Find the
Transient Cache
toggle. - Turn it
ON
.
Optional: Choose the expiration time for the cache in seconds (default: 1 hours).
3. Save Changes
Click Save Changes to apply the caching settings.
Expected Results
- Product/post filters will load faster after the initial request.
- Repeated filters (e.g., clicking "Red" shoes twice) will no longer trigger new queries.
- Server load is reduced during high-traffic events.
Troubleshooting
Caching Not Working?
- Check if WP Cache is enabled: Add
define('WP_CACHE', true);
towp-config.php
. - Using Redis/Memcached? Ensure it's installed and active on your host. Contact hosting support if unsure.
- No cache plugin? Consider using one like W3 Total Cache or Redis Object Cache.
Changes Not Reflecting?
Cached results may delay new content/filters from showing.
Clear transients using:
A plugin like WP-Optimize, or
Run this WP CLI command:
wp transient delete --all