Skip to content

Commit a39ffd0

Browse files
authored
Merge pull request #14080 from Earl0fPudding/custom-cache-prefix
2 parents eb33b7d + 637b31b commit a39ffd0

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

admin_manual/configuration_server/caching_configuration.rst

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ The following options are available to configure when using a single redis serve
203203
'memcache.locking' => '\OC\Memcache\Redis',
204204
'memcache.distributed' => '\OC\Memcache\Redis',
205205
'memcache.local' =>'\OC\Memcache\Redis' ,
206+
'memcache_customprefix' => 'mynextcloudprefix',
206207
'redis' => [
207208
// 'host' => see connection parameters below
208209
// 'port' => see connection parameters below
@@ -219,6 +220,7 @@ are optional)::
219220
'memcache.locking' => '\OC\Memcache\Redis',
220221
'memcache.distributed' => '\OC\Memcache\Redis',
221222
'memcache.local' =>'\OC\Memcache\Redis' ,
223+
'memcache_customprefix' => 'mynextcloudprefix',
222224
'redis.cluster' => [
223225
'seeds' => [ // provide some/all of the cluster servers to bootstrap discovery, port required
224226
'cache-cluster:7000',
@@ -395,3 +397,17 @@ Cache Directory location
395397
The cache directory defaults to ``data/$user/cache`` where ``$user`` is the
396398
current user. You may use the ``'cache_path'`` directive in ``config.php``
397399
(See :doc:`config_sample_php_parameters`) to select a different location.
400+
401+
Cache Key Prefix for Redis or Memcached
402+
---------------------------------------
403+
404+
By default, Nextcloud generates a semi-unique prefix for cache keys using information like instance ID, version etc. to mitigate the problem of
405+
collisions when using the same cache for multiple Nextcloud instances.
406+
If you want to make sure to prevent collisions altogether, you can use the following
407+
setting to define your custom prefix::
408+
409+
'memcache_customprefix' => 'mynextcloudprefix',
410+
411+
This also allows you to create ACLs in Redis and limit the keys specific users can access
412+
(e.g. if you want to isolate specific Nextcloud instances when using the same cache).
413+
This may be security-relevant for you.

admin_manual/installation/example_centos.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ Example config::
220220
'memcache.distributed' => '\OC\Memcache\Redis',
221221
'memcache.locking' => '\OC\Memcache\Redis',
222222
'memcache.local' => '\OC\Memcache\APCu',
223+
'memcache_customprefix' => 'nextcloud_centos',
223224
'redis' => array(
224225
'host' => 'localhost',
225226
'port' => 6379,

0 commit comments

Comments
 (0)