diff --git a/README.md b/README.md index 1b6d3f92..40b3ca92 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,7 @@ The Redis Object Cache plugin comes with vast set of configuration options. If y | `WP_REDIS_DISABLE_BANNERS` | `false` | Disables promotional banners | | `WP_REDIS_DISABLE_DROPIN_CHECK` | `false` | Disables the extended drop-in write test | | `WP_REDIS_DISABLE_DROPIN_AUTOUPDATE` | `false` | Disables the drop-in auto-update | +| `WP_REDIS_DISABLE_GROUP_FLUSH` | `false` | Disables group flushing with Lua script and uses `flushdb` call instead | | `WP_REDIS_SSL_CONTEXT` | `[]` | TLS connection options for `tls` or `rediss` scheme | diff --git a/includes/object-cache.php b/includes/object-cache.php index 7639c0cf..b5126f01 100644 --- a/includes/object-cache.php +++ b/includes/object-cache.php @@ -1768,6 +1768,10 @@ public function flush() { * @return bool Returns TRUE on success or FALSE on failure. */ public function flush_group( $group ) { + if ( defined( 'WP_REDIS_DISABLE_GROUP_FLUSH' ) && WP_REDIS_DISABLE_GROUP_FLUSH ) { + return $this->flush(); + } + $san_group = $this->sanitize_key_part( $group ); if ( is_multisite() && ! $this->is_global_group( $san_group ) ) {