Does ASP.NET send ALL session data from the SQL server at the beginning of the query or only as needed?

I am using ASP.NET, session state is stored outside the process in SQL Server. When a page request begins, all the contents of a user session extracted from the database, deserialized and sent to the ASP.NET process in one fell swoop, or individual objects transferred to the ASP.NET process only as necessary?

Basically, I have a page that stores some large objects in the session, and it's hard for me to determine when data can be deleted. If the data is extracted from the database only when it is used, then the problem does not arise; if all session state is placed in ASP.NET for every page request, I may have a performance issue.

+3
source share
1 answer

All this at a time. The session object is recreated from the repository at the beginning of the request. It allows ASP.NET to work the same regardless of what is at the core of the repository.

Here you can find the details.

+5
source

Source: https://habr.com/ru/post/1697846/


All Articles