From 5c6d3a09fcd11c719fd89b2110a76635251808dd Mon Sep 17 00:00:00 2001 From: Martin <31348196+Earl0fPudding@users.noreply.github.com> Date: Tue, 17 Feb 2026 18:10:08 +0100 Subject: [PATCH 1/7] Add memcache.customprefix docu to caching_configuration.rst Signed-off-by: Martin <31348196+Earl0fPudding@users.noreply.github.com> --- .../caching_configuration.rst | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/admin_manual/configuration_server/caching_configuration.rst b/admin_manual/configuration_server/caching_configuration.rst index 1346352a772..45b36c398f8 100644 --- a/admin_manual/configuration_server/caching_configuration.rst +++ b/admin_manual/configuration_server/caching_configuration.rst @@ -49,7 +49,7 @@ Small/Private home server Only use APCu:: - 'memcache.local' => '\OC\Memcache\APCu', + 'l' => '\OC\Memcache\APCu', Organizations with single-server ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ @@ -187,6 +187,7 @@ The following options are available to configure when using a single redis serve 'memcache.locking' => '\OC\Memcache\Redis', 'memcache.distributed' => '\OC\Memcache\Redis', 'memcache.local' =>'\OC\Memcache\Redis' , + 'memcache.customprefix' => 'mynextcloudprefix', 'redis' => [ // 'host' => see connection parameters below // 'port' => see connection parameters below @@ -202,6 +203,7 @@ The following options are available to configure when using a redis cluster (all 'memcache.locking' => '\OC\Memcache\Redis', 'memcache.distributed' => '\OC\Memcache\Redis', 'memcache.local' =>'\OC\Memcache\Redis' , + 'memcache.customprefix' => 'mynextcloudprefix', 'redis.cluster' => [ 'seeds' => [ // provide some/all of the cluster servers to bootstrap discovery, port required 'cache-cluster:7000', @@ -374,3 +376,17 @@ Cache Directory location The cache directory defaults to ``data/$user/cache`` where ``$user`` is the current user. You may use the ``'cache_path'`` directive in ``config.php`` (See :doc:`config_sample_php_parameters`) to select a different location. + +Cache Key Prefix for Redis or Memcached +--------------------------------- + +By default, Nextcloud generates a semi-unique prefix for cache keys using information like instance ID, version etc. to mitigate the problem of +collisions when using the same cache for multiple Nextcloud instances. +If you want to make sure to prevent collisions alltogether, you can use the following +setting to define your custom prefix:: + + 'memcache.customprefix' => 'mynextcloudprefix', + +This also allows you to create ACLs in Redis and limit the keys specific users can access +(e.g. if you want to isolate specific Nextcloud instances when using the same cache). +This may be security-relevant for you. From 13a7afb1ca65fae13cb6774c9b5773d982721ae4 Mon Sep 17 00:00:00 2001 From: Martin <31348196+Earl0fPudding@users.noreply.github.com> Date: Tue, 17 Feb 2026 18:15:56 +0100 Subject: [PATCH 2/7] Add memcache.customprefix docu to config_sample_php_parameters.rst Signed-off-by: Martin <31348196+Earl0fPudding@users.noreply.github.com> --- .../config_sample_php_parameters.rst | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/admin_manual/configuration_server/config_sample_php_parameters.rst b/admin_manual/configuration_server/config_sample_php_parameters.rst index 2f0e8c5d044..d1ce330f4ff 100644 --- a/admin_manual/configuration_server/config_sample_php_parameters.rst +++ b/admin_manual/configuration_server/config_sample_php_parameters.rst @@ -2717,6 +2717,21 @@ Memory caching backend for locally stored data Defaults to ``none`` +memcache.customprefix +^^^^^^^^^^^^^^^^^^^^^ + + +:: + + 'memcache.customprefix' => 'mynextcloudprefix', + +Custom cache key prefix for Redis or Memcached + +* Used for avoiding collisions in the cache system +* May be used for ACL restrictions in Redis + +Defaults to an auto-generated, semi-unique ID + memcache.distributed ^^^^^^^^^^^^^^^^^^^^ From f651f10113820c8902f318d09943e3c6f22c42e3 Mon Sep 17 00:00:00 2001 From: Martin <31348196+Earl0fPudding@users.noreply.github.com> Date: Tue, 17 Feb 2026 18:18:11 +0100 Subject: [PATCH 3/7] Add memcache.customprefix to example_centos.rst Signed-off-by: Martin <31348196+Earl0fPudding@users.noreply.github.com> --- admin_manual/installation/example_centos.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/admin_manual/installation/example_centos.rst b/admin_manual/installation/example_centos.rst index 0d75bc08959..50babea676f 100644 --- a/admin_manual/installation/example_centos.rst +++ b/admin_manual/installation/example_centos.rst @@ -220,6 +220,7 @@ Example config:: 'memcache.distributed' => '\OC\Memcache\Redis', 'memcache.locking' => '\OC\Memcache\Redis', 'memcache.local' => '\OC\Memcache\APCu', + 'memcache.customprefix' => 'nextcloud_centos', 'redis' => array( 'host' => 'localhost', 'port' => 6379, From cacb51923d39fed87396c6e88b1233993d5ed1ad Mon Sep 17 00:00:00 2001 From: Martin <31348196+Earl0fPudding@users.noreply.github.com> Date: Tue, 17 Feb 2026 18:23:33 +0100 Subject: [PATCH 4/7] Fix unwanted change in caching_configuration.rst Signed-off-by: Martin <31348196+Earl0fPudding@users.noreply.github.com> --- admin_manual/configuration_server/caching_configuration.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin_manual/configuration_server/caching_configuration.rst b/admin_manual/configuration_server/caching_configuration.rst index 45b36c398f8..2cf26f35d66 100644 --- a/admin_manual/configuration_server/caching_configuration.rst +++ b/admin_manual/configuration_server/caching_configuration.rst @@ -49,7 +49,7 @@ Small/Private home server Only use APCu:: - 'l' => '\OC\Memcache\APCu', + 'memcache.local' => '\OC\Memcache\APCu', Organizations with single-server ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ From 1d2db9cd0d2bd6af7ccb87d85b8306dcedf06b16 Mon Sep 17 00:00:00 2001 From: Martin <31348196+Earl0fPudding@users.noreply.github.com> Date: Wed, 18 Feb 2026 12:11:35 +0100 Subject: [PATCH 5/7] Change customprefix setting name in example_centos.rst Signed-off-by: Martin <31348196+Earl0fPudding@users.noreply.github.com> --- admin_manual/installation/example_centos.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin_manual/installation/example_centos.rst b/admin_manual/installation/example_centos.rst index 50babea676f..89d0a2be6e8 100644 --- a/admin_manual/installation/example_centos.rst +++ b/admin_manual/installation/example_centos.rst @@ -220,7 +220,7 @@ Example config:: 'memcache.distributed' => '\OC\Memcache\Redis', 'memcache.locking' => '\OC\Memcache\Redis', 'memcache.local' => '\OC\Memcache\APCu', - 'memcache.customprefix' => 'nextcloud_centos', + 'memcache_customprefix' => 'nextcloud_centos', 'redis' => array( 'host' => 'localhost', 'port' => 6379, From 68ce2ee6fd19e773af70022f643840b084b00260 Mon Sep 17 00:00:00 2001 From: Martin <31348196+Earl0fPudding@users.noreply.github.com> Date: Wed, 18 Feb 2026 12:12:21 +0100 Subject: [PATCH 6/7] Change customprefix setting name in config_sample_php_parameters.rst Signed-off-by: Martin <31348196+Earl0fPudding@users.noreply.github.com> --- .../configuration_server/config_sample_php_parameters.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/admin_manual/configuration_server/config_sample_php_parameters.rst b/admin_manual/configuration_server/config_sample_php_parameters.rst index d1ce330f4ff..12a58f0363e 100644 --- a/admin_manual/configuration_server/config_sample_php_parameters.rst +++ b/admin_manual/configuration_server/config_sample_php_parameters.rst @@ -2717,13 +2717,13 @@ Memory caching backend for locally stored data Defaults to ``none`` -memcache.customprefix +memcache_customprefix ^^^^^^^^^^^^^^^^^^^^^ :: - 'memcache.customprefix' => 'mynextcloudprefix', + 'memcache_customprefix' => 'mynextcloudprefix', Custom cache key prefix for Redis or Memcached From 1bca82b49df80e046762a23c8a5b668abb3ddfe8 Mon Sep 17 00:00:00 2001 From: Martin <31348196+Earl0fPudding@users.noreply.github.com> Date: Wed, 18 Feb 2026 12:13:00 +0100 Subject: [PATCH 7/7] Change customprefix setting name in caching_configuration.rst Signed-off-by: Martin <31348196+Earl0fPudding@users.noreply.github.com> --- admin_manual/configuration_server/caching_configuration.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/admin_manual/configuration_server/caching_configuration.rst b/admin_manual/configuration_server/caching_configuration.rst index 2cf26f35d66..6db6429ce5a 100644 --- a/admin_manual/configuration_server/caching_configuration.rst +++ b/admin_manual/configuration_server/caching_configuration.rst @@ -187,7 +187,7 @@ The following options are available to configure when using a single redis serve 'memcache.locking' => '\OC\Memcache\Redis', 'memcache.distributed' => '\OC\Memcache\Redis', 'memcache.local' =>'\OC\Memcache\Redis' , - 'memcache.customprefix' => 'mynextcloudprefix', + 'memcache_customprefix' => 'mynextcloudprefix', 'redis' => [ // 'host' => see connection parameters below // 'port' => see connection parameters below @@ -203,7 +203,7 @@ The following options are available to configure when using a redis cluster (all 'memcache.locking' => '\OC\Memcache\Redis', 'memcache.distributed' => '\OC\Memcache\Redis', 'memcache.local' =>'\OC\Memcache\Redis' , - 'memcache.customprefix' => 'mynextcloudprefix', + 'memcache_customprefix' => 'mynextcloudprefix', 'redis.cluster' => [ 'seeds' => [ // provide some/all of the cluster servers to bootstrap discovery, port required 'cache-cluster:7000', @@ -385,7 +385,7 @@ collisions when using the same cache for multiple Nextcloud instances. If you want to make sure to prevent collisions alltogether, you can use the following setting to define your custom prefix:: - 'memcache.customprefix' => 'mynextcloudprefix', + 'memcache_customprefix' => 'mynextcloudprefix', This also allows you to create ACLs in Redis and limit the keys specific users can access (e.g. if you want to isolate specific Nextcloud instances when using the same cache).