Skip to content

Conversation

@twsouthwick
Copy link
Member

This allows the features for HttpApplication to be insterted in the HttpContext at the beginning of the request, but will only be invoked in the .UseSystemWebAdapters() middleware call. This enables a request to potentially modify behavior of the features if needed before invoking the middleware.

A nice side effect of this is that an HttpApplication instance will only be retrieved from the pool if it is actually used within a request, otherwise, it will never be retrieved. This is one of the more expensive parts of the emulated IIS pipeline as we have to assign an HttpApplication to a request, so it can potentially prevent a request from needing to perform this.

This allows the features for HttpApplication to be insterted in the HttpContext at the beginning of the request, but will only be invoked in the `.UseSystemWebAdapters()` middleware call. This enables a request to potentially modify behavior of the features if needed before invoking the middleware.

A nice side effect of this is that an HttpApplication will only be created if it is actually used within a request, otherwise, it will never be retrieved (which is one of the more expensive parts of the emulated IIS pipeline as we have to assign an HttpApplication to a request).
@twsouthwick twsouthwick enabled auto-merge (squash) October 10, 2023 17:31
@twsouthwick twsouthwick requested a review from Tratcher October 10, 2023 17:32
@twsouthwick twsouthwick merged commit 4b112d8 into main Oct 10, 2023
@twsouthwick twsouthwick deleted the tasou/http-application-features branch October 10, 2023 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants