Cache whole result set or based on user?
In my web application i have statistics which shown for each user separately ie. posts made , posts made today , articles started by and so on...
Each user has his own special statistics.
What is more flexible and "right" to work with one huge DataTable in Cache with whole data from all users and then loop thought DataTable to find certain user data or to cache each user ie. cacheObj + userID...
User can filter his own results by dates and type开发者_如何学编程s which is why i need flexible and reliable solution
thanks...
The easiest way would be to just cache each user's results in the Session State. It's unique to each user. When they log in/access it for the first time, calculate the results and store it there. That way too, you don't have to cache all user's information in memory all the time. You just have to store it for who is logged in at the moment.
精彩评论