Reputation: 1535
I'm working with Infinispan 8.1.0.
In my project we have chosen infinispan cache like a session Cache the way that each time one user is connected to my system, a named cache, based on user-id and session-id, is created.
Using infinispan like a Session Cache, there is the need to handle the cache lifespan as we should have to do with a session memory. So the problems i have to face up to are:
How can i delete the user-session cache when user closes the browser without clicking on the default logout button?
How can i refresh at runtime and dynamically the lifespan of the user-session cache? Indeed the user session expiration-time has to be refreshed after each user request, otherwise after X minutes the user will be not able to find his data inside the cache, even if his session is still alive.
So is it possible with infinispan to set at runtime and after the cache creation the cache expiration without creating it again?
Upvotes: 0
Views: 108
Reputation: 5888
You think about the cache differently than it's meant to be used. Similar to table in relational DBs, there should be single cache for all users, and the user-id and session-id should form a key rather than a cache name.
Then, you can set default expiration settings for entries in this cache (overridable per entry). But the cache itself is not meant to expire as a whole.
Upvotes: 1