diff --git a/provider/http.go b/provider/http.go index 4fca739d8..6bbe7ad52 100644 --- a/provider/http.go +++ b/provider/http.go @@ -34,6 +34,8 @@ func init() { registry.AddCtx("http", NewHTTPProviderFromConfig) } +var mc = httpcache.NewMemoryCache() + // Auth is the authorization config type Auth struct { Type, User, Password string @@ -101,9 +103,10 @@ func NewHTTP(log *util.Logger, method, uri string, insecure bool, cache time.Dur } // http cache - cacheTransport := httpcache.NewMemoryCacheTransport() - cacheTransport.Transport = p.Client.Transport - p.Client.Transport = cacheTransport + p.Client.Transport = &httpcache.Transport{ + Cache: mc, + Transport: p.Client.Transport, + } // ignore the self signed certificate if insecure {