Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate HttpApplication feature insertion from invocation #417

Merged
merged 2 commits into from
Oct 10, 2023

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
5 checks passed
@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.

2 participants