After creating a proof of concept for the ASP.NET MVC site and ensuring proper separation of problems, I noticed that I was making a lot of costly redundant database queries for current user information.
Being historically desktop staff and services, my first thought was to cache db results in some static s. There have not been many searches to make sure that this will save current user data throughout the AppDomain for all users.
Then I thought about using HttpContext.Current . However, if you put the material here when the user logs out, then when you enter your cached data it will be outdated. I could update this every time I log in / out, but I can’t say if this is correct. In the absence of other ideas, this is where I bow.
What is an easy way to cache user details accurately and don’t need to make tons of database calls?
database caching asp.net-mvc
Dinah
source share