I'm using ASP.NET, with session state stored out of process in SQL Server. When a page request begins, are the entire contents of a user's session retrieved from the DB, deserialized, and sent to the ASP.NET process in one fell swoop, or are individual objects transferred to the ASP.NET process only as needed?
我正在使用ASP.NET,会话状态存储在SQL Server的进程外。当页面请求开始时,是否从DB中检索用户会话的全部内容,反序列化并一次性发送到ASP.NET进程,或者仅在需要时将单个对象传输到ASP.NET进程?
Basically, I have a page that stores some large objects in session, and it's hard for my application to determine when the data can be disposed. If the data is only pulled out of the DB when it's used then there isn't an issue; if the entire session state is chunked to ASP.NET for each page request, I might have a performance issue.
基本上,我有一个页面在会话中存储一些大对象,我的应用程序很难确定何时可以处理数据。如果数据仅在使用时从数据库中拉出,则没有问题;如果为每个页面请求将整个会话状态分块到ASP.NET,我可能会遇到性能问题。
1 个解决方案
#1
5
It's all in one go. The session object is recreated from the store at the beginning of the request. It lets ASP.NET work the same way no matter what the underlying store is.
这一切都是一气呵成的。在请求开始时从存储重新创建会话对象。它允许ASP.NET以相同的方式工作,无论底层存储是什么。
You can find the gory details here.
你可以在这里找到血腥的细节。
#1
5
It's all in one go. The session object is recreated from the store at the beginning of the request. It lets ASP.NET work the same way no matter what the underlying store is.
这一切都是一气呵成的。在请求开始时从存储重新创建会话对象。它允许ASP.NET以相同的方式工作,无论底层存储是什么。
You can find the gory details here.
你可以在这里找到血腥的细节。