asp.net mvc - Caching user data to avoid excess database trips -


after creating proof of concept asp.net mvc site , making sure appropriate separation of concerns in place, noticed making lot of expensive redundant database calls information current user.

being historically desktop , services person, first thought cache db results in statics. didn't take searching see doing persist current user's data across whole appdomain users.

next thought of using httpcontext.current. however, if put stuff here when user logged out, when log in cached data out of date. update every time login/logout occurs can't tell if feels right. in absence of other ideas, i'm leaning.

what lightweight way accurately cache user details , avoid having make tons of database calls?

if information want cache per-user , while active, session right place.
http://msdn.microsoft.com/en-us/library/system.web.sessionstate.httpsessionstate.aspx


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -