MCPcopy Create free account
hub / github.com/cli/cli / NewCachedHTTPClient

Function NewCachedHTTPClient

api/http_client.go:187–191  ·  view source on GitHub ↗
(httpClient *http.Client, ttl time.Duration)

Source from the content-addressed store, hash-verified

185}
186
187func NewCachedHTTPClient(httpClient *http.Client, ttl time.Duration) *http.Client {
188 newClient := *httpClient
189 newClient.Transport = AddCacheTTLHeader(httpClient.Transport, ttl)
190 return &newClient
191}
192
193// NewCachedHTTPClientWithStatuses is like NewCachedHTTPClient, but it also caches responses with the given status
194// codes, such as 403, which are not cached by default.

Callers 6

extensionManagerFunction · 0.92
CapiClientFuncFunction · 0.92
NewCmdExtensionFunction · 0.92
newReadmeGetterFunction · 0.92

Calls 1

AddCacheTTLHeaderFunction · 0.85

Tested by

no test coverage detected