Managing HttpClient Lifetimes with IHttpClientFactory in .NET
Use IHttpClientFactory to pool HttpMessageHandler instances, avoid socket exhaustion, and respect DNS changes. Register named or typed clients in Program.cs, inject the factory or typed interface, and tune handler lifetime for your deployment environment.