I was wondering how to send (in my case) SqlFileStream directly to the client through our Nancy-API without loading the stream into memory.
So far I have managed to transfer the stream, but Nancy StreamResponse copies sourcestream (= SqlFileStream) to the output stream, which leads to an increase in massive memory. Where I just wanted to send a stream through.
I did this job in WebApi, where WebApi was registered in the Owin pipeline. No increase in memory is noticeable, which is excellent when we talk about fairly large streams (> 100 MB). But of course, I would prefer to stick with one framework API, if possible.
Any tips?
source
share