Reputation: 685
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
Upvotes: 1
Views: 1428
Reputation: 359
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.
Upvotes: 4