Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redis prefix #259

Open
bencyoung opened this issue Oct 17, 2018 · 5 comments
Open

Redis prefix #259

bencyoung opened this issue Oct 17, 2018 · 5 comments

Comments

@bencyoung
Copy link

Would it be possible to add an optional prefix to all of the keys in the Redis DB. We already store some other data in Redis, and if you're using clustering then you can only use DB 0, so it would be nice if they didn't overlap. It could be configurable so that it doesn't impact people who don't need it?

@MichaCo
Copy link
Owner

MichaCo commented Oct 17, 2018

I'm not sure if that's really necessary. You can easily craft prefixed cache keys yourself ;)

@bencyoung
Copy link
Author

bencyoung commented Oct 17, 2018

That's true, although you'd need to know at the cache consumer side that:

  1. You'd using Redis
  2. There are other users of the same Redis DB

so it means the knowledge has to propagate. It's not a major concern, but more of a nice to have.

@MichaCo
Copy link
Owner

MichaCo commented Oct 17, 2018

Yup I agree, would be nice to have.
I'll keep it in mind

@gautelo
Copy link

gautelo commented Nov 29, 2018

I support this notion. Alternatively, or in addition, please add a similar option for prefixing regions.

@Baune8D
Copy link

Baune8D commented Oct 29, 2019

I also support this, i really feel this feature is missing.

Microsoft.Extensions.Caching.Redis already have a feature like this using InstanceName

services.AddDistributedRedisCache(options =>
{
    options.Configuration = "ConnectionString";
    options.InstanceName = "CacheKeyPrefix";
});

We run multiple applications on the same Redis instance and use prefixes to seperate applications. It gets really hard to enforce these key prefixes throughout an application without a feature like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants