AspNetCoreRateLimit
AspNetCoreRateLimit copied to clipboard
Ability to customize distributed cache keys
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
Seconded.
I am interested in that too.
+1
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
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?