sourcegraph/internal/httpcli/noop_response_cache.go
Erik Seliger 674217f83d
Use uncached doer for downloading packages (#48977)
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>
2023-03-22 18:56:31 +00:00

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) {}