AspNetCoreRateLimit icon indicating copy to clipboard operation
AspNetCoreRateLimit copied to clipboard

Ability to customize distributed cache keys

Open mscrivo opened this issue 6 years ago • 5 comments

Is it possible to customize the distributed cache keys? I tried setting this up with Redis, and it seems to put everything in the root with a hashed value as the key. Ideally, I'd like to specify a prefix like ServiceName:Cache:Hash

mscrivo avatar Mar 05 '19 17:03 mscrivo

Seconded.

STRATZ-Ken avatar Jun 12 '19 00:06 STRATZ-Ken

I am interested in that too.

corcus avatar Mar 03 '20 15:03 corcus

+1

raschle avatar Sep 03 '21 07:09 raschle

I solved it by creating an implementation of the ProcessingStrategy copied from the RedisProcessingStrategy. For simplicity the prefix is hard coded but can easily be read from any configuration available.

https://gist.github.com/raschle/ff11042b966ed70e610f4e8f3b4063fd

raschle avatar Sep 03 '21 09:09 raschle

Check out this PR which modifies the existing RedisProcessingStrategy to accept configuration options. Maybe I should make this not only possible with Redis but all cache types?

jacobmstein avatar Mar 23 '22 16:03 jacobmstein