Azure Blob Storage Slow Using FileStreamResult Controller.File
<p>I have an ASP.NET web site running on Azure Web Apps account. I also have a storage account using block blob mode.</p>

<p>I upload a video file that is only about 9 mb. It takes about 10 seconds to upload.</p>

<p>I then show a list of files to the user with a download link. When you click on the download link and "save as" the file it downloads. It takes > 30 seconds to download this same file.</p>

<p>This is extremely slow. It is only 9 mb and I have super fast internet. I can download most files from normal sites at > 3MB (mega byte) per second, so I would expect a 9 mb file to take about 3 seconds.</p>

<p>Here is the code I am using to return the stream via my controller:</p>

<pre><code>    public Stream GetAttachmentStream(string attachmentId)
    {
        MemoryStream stream = new MemoryStream();
        var storage = Storage.Instance("StorageConnectionStringLive");
        storage.GetBlob(attachmentId, stream);

        stream.Seek(0, SeekOrigin.Begin);

        return stream;
    }

    public ActionResult GetFile(string id, string fileName, string mimeType)
    {
        var fileStream = GetAttachmentStream(id);

        Response.AppendHeader("Content-Disposition", "inline; filename=" + fileName);
        return File(fileStream, mimeType);
    }
</code></pre>