mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 19:51:50 +00:00
We've encountered that all our external requests are cached in redis, which means (1) that we need to read the entire body into memory so we can serialize it for redis, and (2) that we store potentially gigantic binary files in redis, which we never need to fetch again. This introduces an uncached version of the external doer, adds comments on when to use which, and modifies each of the packages clients to use that doer for the Download operation. ## Test plan The unit tests --------- Co-authored-by: Noah Santschi-Cooney <noah@santschi-cooney.ch>
8 lines
271 B
Go
8 lines
271 B
Go
package httpcli
|
|
|
|
type NoopCache struct{}
|
|
|
|
func (c NoopCache) Get(key string) (responseBytes []byte, ok bool) { return nil, false }
|
|
func (c NoopCache) Set(key string, responseBytes []byte) {}
|
|
func (c NoopCache) Delete(key string) {}
|