๐ filters for github.com/gregjones/httpcache
$ go get -u moul.io/hcfilters
// before
client := &http.Client{
Transport: httpcache.NewTransport(
diskcache.New(diskcachePath),
),
}
// after
client := &http.Client{
Transport: httpcache.NewTransport(
hcfilters.MaxSize( // skip caching results > 2Mb
diskcache.New(diskcachePath),
2*1024*1024,
),
),
}
ยฉ 2020 Manfred Touron
Licensed under the Apache License, Version 2.0 (LICENSE-APACHE
) or the MIT license (LICENSE-MIT
), at your option. See the COPYRIGHT
file for more details.
SPDX-License-Identifier: (Apache-2.0 OR MIT)