5

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");
2
  • 2
    The value can be changed, so the method must get the value from the server every time to return the latest value. Commented Jul 2, 2015 at 21:23
  • 1
    StackExchange.Redis does not use Local in Memory Cache. You can add this yourself in your application code. Commented Jul 6, 2015 at 16:33

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.