如何前提= QUOT; managedHandler"对于模块的工作? [英] How does preCondition="managedHandler" work for modules?

查看:175
本文介绍了如何前提= QUOT; managedHandler"对于模块的工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

阅读有关综合管线一些文档后,我很困惑有关IIS如何确定何时运行管理的模块,有什么要求管理实际上是,以及如何确定,例如:

After reading some documentation about the integrated pipeline I'm confused about how IIS determines when to run managed modules, what a managed request actually is, and how that is determined, e.g.:

HTTP:// WWW .iis.net /学习/应用程序的框架/建设和运行,ASPNET的应用程序/ ASPNET集成与 - IIS
http://blogs.msdn.com/b/tmarq/存档/ 2007/08/30 / IIS-7-0-ASP净管道模块,处理程序和-preconditions.aspx

管理请求被多次提到。有一个实例,其中解释了有管理的要求是有一个映射到托管处理程序的请求。另外还有一个报价说一个处理程序是一个特殊的模块(第二个链接)。

"Managed" requests are mentioned several times. There's one instance where it is explained that a managed request is a request that has a mapping to a managed handler. There's also a quote saying that a handler is a "special" module (second link).

模块被描述为,对于运行一些的每个的请求和处理程序有规定,当它应该运行(例如HTTP GET为*的.aspx)的映射(第二和第一链接)。此外,对于[其中我假定作为其中处理程序实际运行点]的模块execute_request_handler自带后管道的几个阶段(begin_request后,进行认证,授权,等等),它意味着有一个步骤是之前发生了这一切,它建立该请求是托管处理程序,以禁用有前提=managedHanlder当请求不是一个托管处理程序模块的执行。

Modules are described as something that runs for every request and that a handler has a mapping that specifies when it should run (e.g. HTTP GET for *.aspx) (second and first links). Furthermore, for the modules the execute_request_handler [which I'm assuming as the point where the handler actually runs] comes after several stages of the pipeline (after begin_request, authenticate, authorize, etc...), it implies that there's a step that happens before all that, that establishes that the request is for a managed handler, so as to disable the execution of modules that have the preCondition="managedHanlder" when the request is not for a managed handler.

我觉得有什么我失踪这里,可以有人流下了有关如何前提=managedHandler正是作品一些轻?

I feel there's something I'm missing here, can someone shed some light about how does preCondition="managedHandler" exactly works?

推荐答案

从这个博客帖子(的http://博客.iis.net / thomad /存档/ 2006/11/04 /先决条件 - what.aspx ):

IIS 7.0引入了新的管理
扩展性模型。处理程序和模块现在可以写成
托管代码和直接集成到IIS请求管道。
,而管理和本地代码之间的切换是一个昂贵的
操作。该managedHandler前提被引入到允许
优化,其中没有任何管理代码需要
请求的性能涉及,例如,当静态文件(html的,.JPG等)
供应。如果请求是由天然
处理程序供应和每个管理模块被配置为与managedHandler
前提没有托管代码被调用。一个实际的情况是Forms身份验证。在
管理Forms身份验证模块有一个managedHandler前提
,当ASP.NET内容(例如*的.aspx)页面
请因此只能调用。如果请求的.html页面表单验证
不叫。如果你想保护与形式
验证所有内容你可以简单地删除该窗体身份验证模块入口的managedHandler前提

The ManagedHandler precondition

IIS 7.0 introduces a new managed extensibility model. Handlers and Modules can now be written in managed code and directly integrated into the IIS request pipeline. But switching between managed and native code is an expensive operation. The managedHandler precondition was introduced to allow optimizing the performance of requests where no managed code needs to be involved, for example when static files (.html, .jpg etc.) are served. No managed code is called if the request is served by a native handler and every managed module is configured with the managedHandler precondition. A practical scenario is Forms authentication. The managed Forms authentication module has a managedHandler precondition and is therefore only called when ASP.NET content (e.g. *.aspx) pages are requested. If a .html page is requested the forms authentication is not called. If you want to protect all your content with forms authentication you can simply remove the managedHandler precondition from the Forms authentication module entry.

总之,如果一个请求可以由天然的IIS模块送达(比方说,例如一个图像),也不会得通过所有被管理的管道(例如,所有的global.asax 事件和甚至更多),产生了巨大的性能提升。

In short, if a request can be served by a native IIS module (say, an image for instance), it will not have to go through all the managed pipeline (for instance, all the "global.asax" events and even more), resulting in a huge performance gain.

编辑:实际的回答你的问题是:处理程序映射。这是一个文件扩展到一个特定的处理程序相关联。您将找到如何在II7编辑这些映射。您还可以找到关于这里处理器映射更多信息。

The actual answer to your question is : Handlers mappings. This is what associates a file extension to a specific handler. You will find below how to edit these mappings in II7. You can also find more information about handler mapping here.

这篇关于如何前提= QUOT; managedHandler"对于模块的工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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