feat(cache): Add ability for optional custom prefix for Redis/Memcached cache keys#58334
Open
Earl0fPudding wants to merge 5 commits intonextcloud:masterfrom
Open
feat(cache): Add ability for optional custom prefix for Redis/Memcached cache keys#58334Earl0fPudding wants to merge 5 commits intonextcloud:masterfrom
Earl0fPudding wants to merge 5 commits intonextcloud:masterfrom
Conversation
Signed-off-by: Martin <31348196+Earl0fPudding@users.noreply.github.com>
Author
|
Backport to v32 would be perfect. |
Contributor
|
Thanks for your pr 👍 This should be implemented in https://github.com/nextcloud/server/blob/master/lib/private/Memcache/Factory.php |
Signed-off-by: Martin <31348196+Earl0fPudding@users.noreply.github.com>
Signed-off-by: Martin <31348196+Earl0fPudding@users.noreply.github.com>
Author
|
Thank you for your feedback, @kesselb ! |
Author
|
PR for documentation: nextcloud/documentation#14080 |
Author
|
/backport to stable32 |
kesselb
reviewed
Feb 17, 2026
….php Signed-off-by: Martin <31348196+Earl0fPudding@users.noreply.github.com>
kesselb
reviewed
Feb 20, 2026
lib/private/Memcache/Factory.php
Outdated
| $instanceid = $config->getValue('instanceid'); | ||
| $installedApps = implode(',', array_keys($versions)) . implode(',', array_values($versions)); | ||
| $this->globalPrefix = hash('xxh128', $instanceid . $installedApps); | ||
| $this->globalPrefix = $customprefix . ($customprefix != '' ? '/' : '') . hash('xxh128', $instanceid . $installedApps); |
Contributor
There was a problem hiding this comment.
Suggested change
| $this->globalPrefix = $customprefix . ($customprefix != '' ? '/' : '') . hash('xxh128', $instanceid . $installedApps); | |
| $this->globalPrefix = $customprefix . hash('xxh128', $instanceid . $installedApps); |
I would prefer the above version to keep it simple.
Signed-off-by: Martin <31348196+Earl0fPudding@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This adds the ability to use a custom prefix for Redis and Memcached keys. This is an optional variable.
One can use the variable setting
memcache_customprefixfor this.Checklist
3. to review, feature component)stable32)