diff --git a/admin_manual/configuration_server/caching_configuration.rst b/admin_manual/configuration_server/caching_configuration.rst index 1346352a772..6db6429ce5a 100644 --- a/admin_manual/configuration_server/caching_configuration.rst +++ b/admin_manual/configuration_server/caching_configuration.rst @@ -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. diff --git a/admin_manual/configuration_server/config_sample_php_parameters.rst b/admin_manual/configuration_server/config_sample_php_parameters.rst index 2f0e8c5d044..12a58f0363e 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 ^^^^^^^^^^^^^^^^^^^^ diff --git a/admin_manual/installation/example_centos.rst b/admin_manual/installation/example_centos.rst index 0d75bc08959..89d0a2be6e8 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,