ASP.NET MVC 5 concurrent requests are queued even with disabled Session

后端 未结 2 762
萌比男神i
萌比男神i 2020-12-17 17:14

Before thinking about downvoting or telling me \"google it\", please read the problem more carefully. This is old/classic problem but old/classic solution is no longer worki

相关标签:
2条回答
  • 2020-12-17 17:35

    Concurrent parallel requests worked for me when I decorated my controller with this attribute

    [SessionState(System.Web.SessionState.SessionStateBehavior.ReadOnly)]
    

    It works better than the above disabling session state and was added back in MVC 3. More info here

    0 讨论(0)
  • 2020-12-17 18:00

    I spent a lot of time on this issue and found much of the information that you saw above also did not correct the issue. My parallel requests were always queuing, I saw this in Internet Explorer as well as Firefox.

    I found this article related to am using an MVC application this article

    This shows that you can use Disabled [SessionState(SessionStateBehavior.Disabled)] instead of setting it to ReadOnly.

    I moved my code that was performing the AJAX GET call to its own controller since I had other code in the current controller that used Session via TempData. This corrected my issue and my $.get() call to the controller with session disabled would process in parallel with the $.post() to the other controller that used session.

    0 讨论(0)
提交回复
热议问题