I am trying to have my server serving a huge file from another server. However, to protect my credential against that remote server, I can't simply redirect the requester to the file url; on the other hand, although using StreamingHttpResponse doesn't add content to memory or hardrive, it does takes more time - the server still need to download the file from the remote then serve it, which doubles up the response time. Is there any way I can "redirect" content of the remote file, without actually downloading it? Thanks.
you can read the file and stream it at the same time.
look at the code in Django 1.5 - using the new StreamingHttpResponse - all you need to do is put the code that reads from the other server into the generator. each time you read some data from the socket, write it to the streaming output.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With