为什么不ASP.Net处理程序在默认情况下支持会话 [英] Why don't ASP.Net handlers support session by default

查看:229
本文介绍了为什么不ASP.Net处理程序在默认情况下支持会话的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我了解,为了使ASP.Net处理器,支持会话状态,你必须实现的IHttpHandler IRequireSessionState ,但为什么不是默认提供的会话状态?如果出于性能的考虑,那么岂不是更好有像 IDoesNotRequireSessionState

I understand that in order for a ASP.Net handler to support session state you need to implement both IHttpHandler and IRequireSessionState, but why isn't session state provided by default? If for performance reasons, then wouldn't it be better to have an interface like IDoesNotRequireSessionState?

推荐答案

它,因为会话是阻止异步操作,而手柄通常用于长时间操作,如制作和文件的下载 - 如果你保持在很长一段时间的操作,你会阻止你的页面的其余部分。

Its because the session is block the asynchronous operations, and the handle is usually used for long time operations, like the making and download of a file - if you keep the session on long time operation you block the rest of your pages.

此外,手柄是最小的得到响应所需的念头让

关于会话锁:结果
<一href=\"http://stackoverflow.com/questions/9426673/web-app-blocked-while-processing-another-web-app-on-sharing-same-session\">Web应用程序被阻止在处理上共享同一个会话结果另一个Web应用程序
<一href=\"http://stackoverflow.com/questions/9052401/jquery-ajax-calls-to-web-service-seem-to-be-synchronous\">jQuery Ajax调用到Web服务似乎是同步结果
<一href=\"http://stackoverflow.com/questions/12284530/asp-net-server-does-not-process-pages-asynchronously\">ASP.NET服务器不处理页面异步结果
更换ASP.Net的会议完全

About the session lock:
Web app blocked while processing another web app on sharing same session
jQuery Ajax calls to web service seem to be synchronous
ASP.NET Server does not process pages asynchronously
Replacing ASP.Net's session entirely

这篇关于为什么不ASP.Net处理程序在默认情况下支持会话的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆