wulfey
wulfey2y ago

Proper usage of `Deno.HttpClient`

Hi! I'm creating an application which allows the internal use of HTTP proxies for certain tasks. In that case, fetch() requests are given an instance of Deno.HttpClient per proxy, but for multiple fetch() calls, if they're supposed to use the same proxy, the same HttpClient instance is used. This is something I am curious about, should I create a new HttpClient for every executed fetch(), or is it fine to reuse the same HttpClients for multiple requests?
1 Reply
wulfey
wulfeyOP2y ago
It's a decision that randomly came to mind, but depending on what is truly better, the background functionality should be based around the proper decision.