IIS stands for Internet Information Services, which is a web server that supports various protocols such as HTTP, HTTPS, FTP, etc. IIS handles requests from web browsers and responds with the requested pages.
The request life cycle is the sequence of events that happen every time an HTTP request is handled by the application2. It consists of the following stages:
- BeginRequest: This is the first event in the pipeline. It is raised when IIS receives the request and determines which application and module should handle it.
- AuthenticateRequest: This event is raised to authenticate the user identity using the configured authentication method (such as Windows, Forms, etc.).
- AuthorizeRequest: This event is raised to authorize the user access to the requested resource using the configured authorization rules (such as roles, permissions, etc.).
- ResolveRequestCache: This event is raised to retrieve the response from the cache if it exists and is valid. If not, the request proceeds to the next stage.
- MapRequestHandler: This event is raised to map the request to the appropriate handler based on the file name extension or other criteria. For example, a request for an .aspx file will be mapped to an ASP.NET page handler.
- AcquireRequestState: This event is raised to acquire the session state for the current request if it exists.
- PreExecuteRequestHandler: This event is raised before executing the handler for the request.
- ExecuteRequestHandler: This event is raised to execute the handler for the request. For example, an ASP.NET page handler will execute the code in the .aspx file and generate the HTML output.
- ReleaseRequestState: This event is raised to release the session state for the current request if it exists.
- UpdateRequestCache: This event is raised to update the cache with the response if needed.
- LogRequest: This event is raised to log the request information such as URL, status code, etc.
- PostLogRequest: This event is raised after logging the request information.
- EndRequest: This is the last event in the pipeline. It is raised when IIS finishes processing the request and sends the response back to the browser.
Tags
Asp.net Core