Search code examples
asp.net.netwebformsrequest-queueing

Why is a .NET request waiting for the other?


As of my empirically gathered knowledge suggests, .NET WebForms is probably using a queue of requests and when the first request is properly handled, the new first comes to the head of the queue and so on. This behavior recently led to a misunderstanding, where we thought that a feature is very slow, but as a matter of fact, some other features always running before it were the slow ones. But this is only a minor misunderstanding. I can imagine more serious problems, for instance a longer request blocking the other requests and I did not find the time yet to test this on multiple sessions, to see whether this queue is session-level, but I think it should be if I am even right about its existence. Hence my question: why are later requests waiting for earlier requests' parsing in .NET WebForms projects?


Solution

  • Probably Session.

    Requests from the same session that use session state don't run concurrently. This means that applications can use session state without needing to worry about race conditions.

    There is no blocking for calls from different sessions. Also not blocking for calls from the same client that have session state disabled or readonly.

    See the MSDN description of the PagesEnableSessionState Enumeration