I'm building ASP.Net MVC application "kinda Game" which deal a lot with online users.
I made Ajax request fired every "10s"
to some Action
to keep user online when he keeps site open.
this Action
update LastActivityDate
for this User
- ((in static List and DataBase)).
So the Question is :
- Is it better to store Online Users in static list and write some code when user log in to add him to that list and then keep manage this list every
"10s"
to kick out the offline users. - Or the best is to load online users
from DataBase whenever i want
OnlineUsers
.
note: I'm using technique from this SO Question to do some periodically tasks like re-manage OnlineUsers static list.