diff --git a/src/Microsoft.AspNetCore.ResponseCaching/Internal/ResponseCacheStream.cs b/src/Microsoft.AspNetCore.ResponseCaching/Internal/ResponseCacheStream.cs index 989e7aa..b8921b8 100644 --- a/src/Microsoft.AspNetCore.ResponseCaching/Internal/ResponseCacheStream.cs +++ b/src/Microsoft.AspNetCore.ResponseCaching/Internal/ResponseCacheStream.cs @@ -40,6 +40,8 @@ public override long Position public void DisableBuffering() { BufferingEnabled = false; + BufferedStream.SetLength(0); + BufferedStream.Capacity = 0; BufferedStream.Dispose(); }