Closed dahovey closed 4 years ago
I apologize, I now see #23 but would like to consider this again. If this library puts values in a cache I believe it should also be able to clear it.
Would you accept a PR implementing one of the above options?
Ugh, I had a namespace mix-up where the ICache<T>
generic type was that of the EntityFramework object not the IdentityServer.Models.*
This seems to resolve my issue with clearing cache for specific client.
Hello,
I need to clear a client cached in Redis on-demand and I am having trouble. Consider an internal API that updates client configuration (in this case updating SQL Server backing store). After the update to SQL Server backing store is made clearing the client cache is required. Then on next request, the cache will be empty and the updated configuration is retrieved from SQL Server store.
I have tried to use the
ICache<Client>
andSetAsync
usingnull
as the client value but this doesn't clear the cache.Is there some way I can successfully clear a specific client cache on demand?
I can imagine a few options:
RedisCache<T>
implementation to includeClearAsync()
method. This would use theKeyDeleteAsync
method on the redis database object.RedisCache<T>
implementation to support overriding. Make injected properties protected and methods should be either be protected virtual, or public virtual.Are either of these options feasible, or is there another way I can manually clear specific client cache?
I could create a pull request with one of these options, but didn't want to do work unnecessarily if another way is possible.