Optimizing your HttpClient usage
summary
Shows that creating a new HttpClient per call causes socket exhaustion — a demo with 20,000 parallel requests throws socket exceptions, and moving a single instance outside the loop finishes successfully. Explains use of Microsoft.Extensions.Http and DI to get IHttpClientFactory which supplies short‑lived HttpClient instances backed by a shared connection pool, contrasts named vs typed clients, demonstrates delegating handlers for logging/auth, and wires Polly policies (exponential backoff + jitter and a circuit breaker) which run in the demos.
AI-written summary · about
chapters (9)
- 0:00HTTP client optimization
- 10:43What is HTTP client
- 20:23HTTP client misuse demo
- 31:05HTTP client factory usage
- 36:57Advanced HTTP client configs
- 44:05Delegating handlers in Blazor
- 48:42Resiliency with Polly
- 53:14Circuit breaker with Polly
- 55:27Resources and closing
related talks
01h 00mOptimizing your HttpClient usage
59mLet's Talk HTTP in .NET Core
01h 31mFive Design Patterns to build resilient Applications
56mSystem Stable : Robust connected applications with Polly
47mASP. NET Basics For Experts
42mBulletproof Transient Error Handling with Polly
01h 02mBuilding cloud-ready applications in .NET
23mThe Short and Happy Lives of TCP and HTTP Requests
