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

Proper use and reuse of HttpClient / IHttpClientFactory #302

Closed
glahaye opened this issue Sep 5, 2023 · 3 comments · Fixed by #578
Closed

Proper use and reuse of HttpClient / IHttpClientFactory #302

glahaye opened this issue Sep 5, 2023 · 3 comments · Fixed by #578
Assignees
Labels
enhancement New feature or request .NET Pull requests that update .net code performance sk team issue webapi Pull requests that update .net code

Comments

@glahaye
Copy link
Contributor

glahaye commented Sep 5, 2023

In order to avoid creating and recreating HttpClient instances all the time (which can lead to port exhaustion, unnecessary overhead in constantly re-establishing TLS connections and so on) while avoiding the problems of only using a single static HttpClient (which can become stale in its DNS resolution), we need to revisit how we creates HttpClient instances and make proper use of IHttpClientFactory injection.

@glahaye glahaye self-assigned this Sep 5, 2023
@glahaye glahaye added enhancement New feature or request webapi Pull requests that update .net code .NET Pull requests that update .net code performance labels Sep 5, 2023
@prabhatranjan
Copy link

Hi @glahaye, is this something that you are already working on?

@glahaye
Copy link
Contributor Author

glahaye commented Nov 6, 2023

@prabhatranjan Yes. As a matter of fact, I should have a PR out today.

@glahaye
Copy link
Contributor Author

glahaye commented Nov 7, 2023

@prabhatranjan See #578

Feel free to add comments and let me know if something is missing or not correct

@glahaye glahaye linked a pull request Nov 7, 2023 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request .NET Pull requests that update .net code performance sk team issue webapi Pull requests that update .net code
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants