DC. Web. httpcompress compression module source code analysis (1)

Source: Internet
Author: User

From today on, I will take a look at the source code of the DC. Web. httpcompress compression module. I also hope you can discuss it together ~

1. First, let's talk about the entire process. We all know that the following things will happen after you click the URL on the page in the browser:

The browser sends an HTTP request to the server. The server finds the page and returns it to the browser. After the browser downloads the file, it starts to load and render the HTML file. If it encounters CSS, The JS reference will send a request again to download the CSS and JS files, we just need to make some "Hands and feet" when requesting pages and CSS and JS files ".

2. Since we are doing something when processing requests, we must be familiar with the processing process of Asp.net and demonstrate this process well.

When we request an aspxpage from the server, the httprequest will be captured by the inetinfo.exe process and handed to your own registeredISAPIThe default ISAPI processed by aspx is aspnet_isapi.dll. The aspnet_isapi.dll is calledHTTP pipeline (pipeline) sends this requestThe aspnet_wp.exe process, and then the Framework processes the request through httpruntime. After processing, the result is returned to the client.

When an HTTP request is sent to httpruntime, the request continues to be sent.In the httpapplication Factory Container, the container provides an httpapplication instance to process requests, and then enters httpmodule-> httphandler factory-> httphandler in sequence.

WhenAfter the processrequest method is processed, the entire httprequest process is complete ~~

3. How should we design the process to implement the compression module?

I would like to raise two points for you to think about first, and the next article begins to enter the source code stage.

A) each request is sent to an httphandler, which is also the best place to process the request.

B) You can register every event in the lifecycle in httpmodule. Similar

 
Public VoidInit (httpapplication APP)
{
App. beginrequest + =NewEventhandler (app_beginrequest );
}

4. Think about time ..........................

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.