Hi there,

I'm using the StreamingHttpResponse to stream a response, it works great. 
Now, I've a middleware that measures the size of req/response that users 
do. 
For normal HttpResponse i use len(response.content) [i know that it does 
not give the bytes, but it's pretty close], for the streaming I can't, and 
I can't use the streaming_content as well.

the docs says ` Because the content can’t be accessed, many middlewares 
can’t function normally.` 
Thus, is there a way to get the length of the response for a 
StreamingHttpResponse?

If I would be able to know the size of the response at some point in time 
(it's an iterator, so i just need to count) and i could put it in the 
request object, how can I make it working with the middleware? beacuse the 
process_response is fired just after the first yield, no?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/f6a89f2a-8f1e-4fd9-8d21-88244251699a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to