From 14b4feb34bcd7c88b88be5fe270d9b6604332bc1 Mon Sep 17 00:00:00 2001 From: Tim Veluwenkamp Date: Thu, 9 Apr 2026 12:11:23 +0200 Subject: [PATCH 1/3] improved wording and add cache ttl explanation to woocommerce redis docs --- ...-woocommerce-and-wordpress-on-hypernode.md | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/docs/ecommerce-applications/woocommerce/how-to-use-redis-with-woocommerce-and-wordpress-on-hypernode.md b/docs/ecommerce-applications/woocommerce/how-to-use-redis-with-woocommerce-and-wordpress-on-hypernode.md index c5be27ea..772e354e 100644 --- a/docs/ecommerce-applications/woocommerce/how-to-use-redis-with-woocommerce-and-wordpress-on-hypernode.md +++ b/docs/ecommerce-applications/woocommerce/how-to-use-redis-with-woocommerce-and-wordpress-on-hypernode.md @@ -11,7 +11,7 @@ myst: Remote Dictionary Server (Redis) is an in-memory, persistent, key-value database known as a data structure server. Unlike similar servers, Redis can store and manipulate high-level data types such as lists, maps, sets, and sorted sets. -By storing important data in its memory, Redis ensures fast data retrieval, significantly boosting performance and reducing response times. +Because Redis stores data in memory, it can return frequently requested data very quickly. This can improve the performance of WordPress and WooCommerce by reducing database load and speeding up response times. ## Which Plugins Can We Use for Redis in WordPress/WooCommerce? @@ -19,10 +19,32 @@ There are several plugins available for Redis. The two most commonly used are [R Due to the complexity of the cache module in "W3 Total Cache" and the possibility that you may already be using other cache plugins, we recommend the "Redis Object Cache" plugin. +## How to set a TTL on Redis keys + +BBy default, most Redis plugins for WordPress do not set a TTL (time to live) on keys stored in Redis. This means cached keys may remain in memory indefinitely, which can eventually fill up Redis memory and lead to performance issues or downtime. + +To set a TTL for all keys stored in Redis, add the following lines to your wp-config.php file: + +```console +define('WP_REDIS_PREFIX', 'example'); +define('WP_REDIS_MAXTTL', '900'); +define('WP_REDIS_SELECTIVE_FLUSH', true); +``` + +### Explanation of the wp-config.php options + +- **WP_REDIS_PREFIX** adds a clear prefix to your Redis keys. This helps prevent key collisions, especially when multiple applications use Redis. +- **WP_REDIS_MAXTTL** sets a maximum lifetime for cached items, in this example 900 seconds. +- **WP_REDIS_SELECTIVE_FLUSH*** ensures that only keys related to this WordPress installation are flushed, instead of clearing the entire Redis database. + ## How to Install Redis Object Cache -Redis is already active on the server on port `6379`. +Redis is already available on Hypernode and listens on port 6379. + +Install the Redis Object Cache plugin through the WordPress Dashboard or with Composer. For general plugin installation steps, see the standard WordPress plugin installation documentation. + +After installing and activating the plugin, go to Settings -> Redis or Network Admin -> Settings -> Redis on Multisite networks -Next, install the Redis Object Cache plugin via the WordPress Dashboard or using Composer. For detailed installation instructions, please refer to the standard installation procedure for WordPress plugins. +Enable object caching and verify that the plugin connects to Redis automatically. -After installing and activating the plugin, navigate to `WordPress` -> `Settings` -> `Redis` or `Network Admin` -> `Settings` -> `Redis on Multisite networks`. Enable the cache and check if the plugin can connect automatically. +If the plugin does not connect automatically, check whether Redis is reachable on 127.0.0.1:6379 and confirm that your WordPress configuration does not override the default connection settings. From bd274812eb1905f37692cb82980b21da3095a01c Mon Sep 17 00:00:00 2001 From: Tim Veluwenkamp Date: Thu, 9 Apr 2026 13:16:21 +0200 Subject: [PATCH 2/3] Update docs/ecommerce-applications/woocommerce/how-to-use-redis-with-woocommerce-and-wordpress-on-hypernode.md Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- ...-to-use-redis-with-woocommerce-and-wordpress-on-hypernode.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/ecommerce-applications/woocommerce/how-to-use-redis-with-woocommerce-and-wordpress-on-hypernode.md b/docs/ecommerce-applications/woocommerce/how-to-use-redis-with-woocommerce-and-wordpress-on-hypernode.md index 772e354e..9c7e2575 100644 --- a/docs/ecommerce-applications/woocommerce/how-to-use-redis-with-woocommerce-and-wordpress-on-hypernode.md +++ b/docs/ecommerce-applications/woocommerce/how-to-use-redis-with-woocommerce-and-wordpress-on-hypernode.md @@ -31,7 +31,7 @@ define('WP_REDIS_MAXTTL', '900'); define('WP_REDIS_SELECTIVE_FLUSH', true); ``` -### Explanation of the wp-config.php options +### Explanation of the wp-config.php options - **WP_REDIS_PREFIX** adds a clear prefix to your Redis keys. This helps prevent key collisions, especially when multiple applications use Redis. - **WP_REDIS_MAXTTL** sets a maximum lifetime for cached items, in this example 900 seconds. From 5cb0dd25588c1c8f4787b053646f86b32a1e3e28 Mon Sep 17 00:00:00 2001 From: Tim Veluwenkamp Date: Thu, 9 Apr 2026 13:33:33 +0200 Subject: [PATCH 3/3] resolved suggestions and add a not about example redis prefix --- ...to-use-redis-with-woocommerce-and-wordpress-on-hypernode.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/ecommerce-applications/woocommerce/how-to-use-redis-with-woocommerce-and-wordpress-on-hypernode.md b/docs/ecommerce-applications/woocommerce/how-to-use-redis-with-woocommerce-and-wordpress-on-hypernode.md index 9c7e2575..3d8d61f0 100644 --- a/docs/ecommerce-applications/woocommerce/how-to-use-redis-with-woocommerce-and-wordpress-on-hypernode.md +++ b/docs/ecommerce-applications/woocommerce/how-to-use-redis-with-woocommerce-and-wordpress-on-hypernode.md @@ -30,6 +30,9 @@ define('WP_REDIS_PREFIX', 'example'); define('WP_REDIS_MAXTTL', '900'); define('WP_REDIS_SELECTIVE_FLUSH', true); ``` +```{important} +Be sure to change the example prefix to a unique name for your application so Redis keys do not get mixed up when Redis is used by multiple applications on the same Hypernode. +``` ### Explanation of the wp-config.php options