How can I store Session information in a hybrid (Database + Memory) way?

纵然是瞬间 提交于 2019-12-25 03:50:45

问题


Memory is good for speed, but is limited, and therefore requires session time limits which then discard the session information permanently.

Database is good for volume storage and catering for more users concurrently and having longer session times. But the increased latency per request is a significant overhead.

How can I configure ASP.Net to use an SQL Database (or other database for that matter), and cache the most recent used Session data in memory?

It would seem there is no inbuilt configuration option ready to go.

Update:

  • By "Session" I refer to the server-side Session store: var userID = Session["UserID"]

来源:https://stackoverflow.com/questions/51922302/how-can-i-store-session-information-in-a-hybrid-database-memory-way

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!