diff --git a/service/cachemdw/caching_middleware.go b/service/cachemdw/caching_middleware.go index 05f4438..1f36ede 100644 --- a/service/cachemdw/caching_middleware.go +++ b/service/cachemdw/caching_middleware.go @@ -4,7 +4,6 @@ import ( "bytes" "io" "net/http" - "strings" "github.com/kava-labs/kava-proxy-service/decode" "github.com/kava-labs/kava-proxy-service/logging" @@ -53,13 +52,12 @@ func (c *ServiceCache) CachingMiddleware( // if request isn't already cached, request is cacheable and response is present in context - cache the response if !isCached && cacheable && ok { headersToCache := getHeadersToCache(w, c.whitelistedHeaders) - memoryLimitIsReachedError := "OOM command not allowed when used memory > 'maxmemory'" if err := c.CacheQueryResponse( r.Context(), decodedReq, typedResponse, headersToCache, - ); err != nil && !strings.Contains(err.Error(), memoryLimitIsReachedError) { + ); err != nil { c.Logger.Error().Msgf("can't validate and cache response: %v", err) } }