> I don't think what you are suggesting would be necessary. Stream-capable > middleware could avoid having to handle both cases by simply wrapping > response.content with a new iterator in all cases, if they want to. > Non-streaming responses can still be iterated. They just have fewer > iterations (as few as one). > > The only reason for a stream-capable middleware to access response.content > explicitly in this case is for improved efficiency when the user doesn't care > about streaming the response. I think GZipping the whole content is probably > more efficient than GZipping chunks of it.
Tai, thanks for your response. I was more than a bit confused on how the response object is normally consumed, which caused me to write a message that made me look more than a bit silly. I see that a single-string iterator is a perfectly good way to do things, thank you for helping me see it. It seems obvious in hindsight. Ryan -- You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com. To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-developers?hl=en.