How to set Redis eviction policy (e.g. allkeys-lru) for WordPress app
-
Hey!
i’m using the WordPress app on Cloudron with the Redis Object Cache plugin.
i’ve allocated 4 GB RAM to Redis, but it keeps filling up over time because there’s no TTL on the keys. i’d rather use Redis’s built-in eviction instead of fixed expirations, like allkeys-lru or allkeys-lfu, so it automatically removes least-used or oldest keys when full.i couldn’t find any option for eviction policy in the Cloudron UI or documentation.
how can i set (or persist) maxmemory-policy allkeys-lru for the Redis instance that my WP app uses?
and where is the redis.conf file located for that instance (if it’s editable from the terminal)?thanks!
-
-
@Miroo you can set
define('WP_REDIS_MAXTTL', '900');
in your wp-config.php . See https://github.com/rhubarbgroup/redis-cache/blob/main/README.md#configuration@joseph said in How to set Redis eviction policy (e.g. allkeys-lru) for WordPress app:
@Miroo you can set define('WP_REDIS_MAXTTL', '900'); in your wp-config.php . See
Thanks but It's less efficient than changing Redis's own eviction policies, as you can set it in a way that it would delete the less used ones instead of just a general expiration for all of them.
@james said in How to set Redis eviction policy (e.g. allkeys-lru) for WordPress app:
Right now it is not possible to configure the Redis service manually that comes with apps.
The default setting for each redis service is:Is it possible to get this settings in the future releases? it will be greatly appreciated!