django-revproxy icon indicating copy to clipboard operation
django-revproxy copied to clipboard

StreamingHTTPResponse and hardcoded threshold

Open ougeee opened this issue 6 years ago • 3 comments

Hi, I was wondering if you had a special reason to hardcode a very low threshold for returning a StreamingHTTPResponse instead of HTTPResponse.

To my understanding, the Django docs generally discourage the use of StreamingHTTPResponse: https://docs.djangoproject.com/en/2.0/ref/request-response/#streaminghttpresponse-objects

How about making this user configurable and add the option not to use StreamingHTTPResponse at all? I'd put together a PR for that in case you support the idea.

ougeee avatar May 24 '18 08:05 ougeee

The reason is that this might proxy very big files and in those cases we had a major memory issue due to that.

seocam avatar May 24 '18 11:05 seocam

Anyway I support the idea of allowing the user to choose what's the best MIN_STREAMING_LENGTH and maybe None meaning streaming shouldn't be used.

seocam avatar May 24 '18 11:05 seocam

Alright then, I've already prepared a proposal. PR is coming soon after the polishing is done.

ougeee avatar May 24 '18 14:05 ougeee