Analysis of iis7.0 managed pipeline Mode

Source: Internet
Author: User

The main factor for IIS improvement and development is that IIS has become a support platform for applications (especially ASP. NET. By integrating ASP. NET directly into IIS 7.0, IIS 7.0 further promotes the development of the platform. From management functions to identity authentication, and even request processing pipelines, related functions have been integrated into IIS 7.0.

Integration of pipelines into IIS 7.0 has two advantages: one is ASP-based. net web applications and IIS 7.0 extensions provide better performance. Second, they gain better control by using managed code.

IIS 7.0 supports two MPs queue modes: one is the latest integrated MPs queue mode provided by IIS 7.0, and the other is the classic MPs queue mode, which is provided by earlier versions of IIS. You can set the MPs queue mode at the application pool level. This function is especially useful to IIS administrators because it allows a server to run only one mode, you can also run the two modes on one server at the same time.

 

ASP. NET performance can be improved because ASP.. NET applications no longer need to exit the pipeline and load the ISAPI process to process ASP.. Net code, and then return to the MPs queue to provide response information for the customer. To maintain application compatibility, IIS 7.0 still supports the classic pipe mode. However,Now try to use the new integration pipeline as much as possible.

 

1. Classic Mode

 

In IIS 6.0, Asp. net plays the role of an ISAPI filter, that is, after the request exits the pipeline. DLL, and then return to the pipeline for further processing, and finally return the response to the client. In IIS 6.0, the HTTP request of a client will be moved along the pipeline until a handler is identified, if the file is an ASP. net file, then it is transferred to ASP. net ISAPI filter, through the processing of ISAPI, before an HTTP response is returned to the client, the request will also return the pipeline. IIS 7.0 continues to provide this mode, which is called the Classic mode.

 

In the classic mode of IIS 6.0, ASP. NET is an ISAPI added to IIS. IIS 7.0 supports this mode to achieve backward compatibility. However, the classic mode lacks the features that many integration modes can provide. In Classic mode, IIS has its own pipelines. These pipelines can be expanded by creating an ISAPI extension, which is known as being difficult to develop. ASP. NET, as an ISAPI extension, is only an integral part of the IIS pipeline.

 

The above situation is well explained. Note: In this case, ASP. NET seems to be a result similar to the latter, and can only be used when IIS processes ISAPI extensions.

You can use the file extension to determine which ISAPI handler to use. For example, you can set the extension. aspx and. the ascx file is mapped to aspnet_isapi.dll, And the extension is. ASP files are mapped to ASP. DLL to process the traditional ASP page. In addition, the extension is. PHP files are mapped to PhP. DLL to process the PHP page, provided that PHP has been installed. DLL.

 

In addition, some features are repeated in the classic modes of IIS 6.0 and IIS 7.0. For example, error processing is a type of repeated feature, because IIS can process non-ASP. NET pages, while ASP. NET can process all pages mapped to aspnet_isapi.dll.

 

In IIS 6.0, we can map all file types to ASP. NET, but there are some restrictions. The maximum limit is how to deal with the default document: a default document can be processed only when it is specified as the default document in global. asax or an HTTP module. Some custom configurations require the use of aspnet_isapi.dll to process all file types. IIS 7.0 can easily solve this problem.

 

In Classic mode, you do not need to modify the web. the current web site is running under the premise of config. Therefore, if the web farm used includes both the IIS 6.0 server and the IIS 7.0 server, or for some reason, the web. the config file is converted to a web. config file, you can use the Classic mode.

 

2. Integrated pipeline Mode

 

Using the integration pipeline in IIS 7.0, developers can integrate their managed code into a module in the pipeline. In earlier versions of IIS, it is difficult for most developers to develop ISAPI filters or applications. In IIS 7.0, the managed code development module can be used as a part of the request pipeline. Using the integrated MPs queue mode of IIS 7.0, You can process ASP. NET files in the MPs queue, so that ASP. NET code can be used at any step of the processing process. Because ASP. NET has been integrated into the channel, ASP. NET features such as identity authentication can also be used to process non-ASP. NET content. Each request can be processed by IIS and ASP. NET without considering its type.

Integration with ASP. NET also means that you can use ASP. NET authentication to control access to any files, folders, and IIS 7.0. Before IIS 7.0 is displayed.. net.. Net files, such as HTML, Perl, and even graphical images, cannot be processed by ASP... Net authentication mechanism for access control. Therefore, you must use Windows integrated authentication or custom authentication mechanisms to control access to files not processed by ASP. NET. Using the integrated pipeline, You can greatly simplify the development of identity authentication methods, and use ASP. NET as an integral part of IIS. Now, the functions of the IIS server are divided into more than 40 modules, so the functions of IIS and ASP. NET are divided into different components. Modules such as staticfilemodule, basicauthenticationmodule, formsauthentication, session, profile, and rolemanager are all part of the IIS pipeline. Note: formsauthentication, session, profile, and rolemanager are originally components of ASP. NET and have no relationship with IIS.

 

The module explains the IIS MPs queue. These modules were originally components of ASP. NET and are now an integral part of the IIS pipeline.

 

The IIS MPs queue provides more than 20 events. developers can use these events to expand the functions of the Web server. In fact, by creating a custom module and updating applicationhost. config, you can only use custom modules, instead of using the built-in modules provided by Microsoft. We can replace the modules in IIS 7.0 with custom modules.

 

 

 

3. Differences between the two modes

 

IIS 7.0 makes some modifications to the configuration file, which can be used by web developers. For example, <system. in the webserver> section, you can identify both the classic and integrated modes. <system. webserver>, and <system. webserver> can be used in applicationhost. the config file can also be set in the web. config file. The <system. webserver> section can control both static pages and dynamic pages. Even in Classic mode, the <system. webserver> section also plays an important role. It helps web developers set different IIS configurations in the web. config file.

 

In integration mode, the HTTP module and HTTP handler are not defined in <system. Web>, but in <system. webserver>. If you run a web. config file that includes the HTTP module or HTTP processing program in integration mode, it will become invalid. Fortunately, Microsoft has already specified an error message numbered 500.22, which shows how to migrate the Web. config file step by step (SEE ).

 

 

 

 

Note: The httpmodules section is retained in the web. config file, which aims to be backward compatible. However, in system. Webserver, the modules section is given priority. The validateintegratedmode Configuration Attribute ensures that IIS does not have issues due to the legacy

The integrated pipeline mode is the default pipeline mode and has some important advantages. What we need to do is to migrate and define all the web. config files of the HTTP processing program and the HTTP module so that they can work normally under IIS 7.0.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.