-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Closed
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-DuplicateThe issue is a duplicate.The issue is a duplicate.WG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module
Description
HttpClient and HttpClientHandler, while implementing IDisposable, are intended to be reused. not re using HttpClient results in significant overhead and loses out on the ability to reuse TCP pools. We currently create and dispose HttpClient and HttpClientHandler instances on every call to the web cmdlets. With large numbers of HTTP requests this can get expensive.
We should investigate the introduction of a single HttpClient/HttpClientHandler. One of my specific concerns is that it may not play nicely in multi-threading scenarios. a static instance of these is supposed ot be thread safe, but, I have no clue if a change in one thread to HttpClientHandler.Credentials (for example) will have an impact on the handler in another thread. *shrugs
Metadata
Metadata
Assignees
Labels
Issue-Enhancementthe issue is more of a feature request than a bugthe issue is more of a feature request than a bugResolution-DuplicateThe issue is a duplicate.The issue is a duplicate.WG-Cmdlets-Utilitycmdlets in the Microsoft.PowerShell.Utility modulecmdlets in the Microsoft.PowerShell.Utility module