title: Return a Stream and write it to disk?
body: <p>I have an ASP.Net Web API project that is returning a response <code>HttpResponseMessage</code>, I'm setting the content of that message to a <code>StreamContent</code> that has been initialized with a <code>Stream</code></p>
  
  <pre><code>HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.OK, channelId);            
  response.Content = new StreamContent(myStream);
  response.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment")
  
  return response;
  </code></pre>
  
  <p>I'm trying to some rudimentary local caching of the file represented by the stream, can I both return the stream and write it to disk without having to wait for it to finish writing it to disk before returning it to the requester?</p>
  
  <p>Alternate method I'm considering would be to have a queue of files to load into my local cache and add the id of the requested file to the queue then send the stream back as a response.  Then have a separate worker process the queue so that file can be retrieved from my local cache next time. </p>