Sharing HttpClient
Nican opened this issue · 0 comments
Nican commented
Looking at the source code of HttpClientWebHelper.cs, it looks like Tweetinvi is making 1 new HttpClient
per request.
Following ASP.NET Core Performance Best Practices documentation on Pool HTTP connections with HttpClientFactory, it mentions that HttpClient
is "designed for reuse".
Creating a new HttpClient
per request adds a lot of overhead, since it creates a new connection every time, instead of re-using existing connections.
Would it be possible to add a configuration to add custom HttpClient
, so that they can re-used?
PS: Thank you for Tweetinvi. I am using this Furland, and have made 20M+ requests to Twitter with it. I am donating you part of my donations.