From d732b1ff9dbae726ad1b30b30c40353e09f551e8 Mon Sep 17 00:00:00 2001 From: poornas Date: Mon, 19 Nov 2018 11:00:46 -0800 Subject: [PATCH] Fix to cache objects on downloads (#6828) fixes #6817 --- cmd/disk-cache.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/disk-cache.go b/cmd/disk-cache.go index 4138400c9..a27f240f2 100644 --- a/cmd/disk-cache.go +++ b/cmd/disk-cache.go @@ -303,7 +303,7 @@ func (c cacheObjects) GetObject(ctx context.Context, bucket, object string, star } dcache.Delete(ctx, bucket, object) } - if startOffset != 0 || length != objInfo.Size { + if startOffset != 0 || (length > 0 && length != objInfo.Size) { // We don't cache partial objects. return GetObjectFn(ctx, bucket, object, startOffset, length, writer, etag, opts) }