1

We are looking at using Redis for sessions state, but it looks like it only support LRU expiry policy when RAM reaches its limit.

So we it wont start cleaning up until RAM runs out.

Previously we've been using AppFabric cache, which allowed use to set an expiry policy based on last access time, e.g. if not read in 30 minutes then expiry

As we are running these machines in a virtualized environment, we'd rather not have to allocated active RAM when it storing data that isn't getting used.

Is there any way to achieve this sort of expiry policy with Redis Cache?

Thanks in Advance, Joel

1 Answer 1

4

Assuming you are using : https://www.nuget.org/packages/Microsoft.Web.RedisSessionStateProvider/

There is expiry on every session in redis. If session is not used then it will be removed automatically from redis when it reaches expiry time.

RedisSessionStateProvider basically sets EXPIRE (http://redis.io/commands/expire) on every session (which is equal to session timeout) every time you access session.

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.