Reputation: 160
StackExchange.Redis Seems to be a popular Redis C# Client. I am unclear on whether StackExchange.Redis uses Multi-Level Caching?
That is If I call the following code numerous times from Asp.net WebSite; Does the Redis Client skip traveling over the wire and instead use the local (Asp.net Built-in Memory Cache)? Or is it the case That We will query an actual redis node each and every-time?
IDatabase db = redis.GetDatabase();
string value = db.StringGet("mykey");
Upvotes: 5
Views: 2573
Reputation: 558
Somewhat dated question, but maybe still useful: if you need a .net multi-level cache with a local in memory layer and an optional distributed one (eg: Redis) all managed transparently for you may I suggest you to take a look at FusionCache ?
I just released it and it would be great if you find it helpful in some ways.
You may also find some of the other features interesting, like the cache stampede prevention to avoid multiple concurrent factory calls at the same time for the same cache key, a fail-safe mechanism, advanced timeouts with background factory completion and support for an optional, distributed 2nd level.
If you will give it a chance please let me know what you think.
/shameless-plug
Upvotes: 2