[Zope] To stream or not to stream

Casey Duncan c.duncan@nlada.org
Mon, 7 Jan 2002 11:07:39 -0500


Quick question for you HTTP gurus out there.

I am writing a product that marshals Zope objects into an XML data stream. In 
implementing the publication of this data through Zope, I have two options:

 - Stream the data to the client as it is returned by the marshaler in 
chunks. I do not know the Content-Length in advance, so I cannot set that 
HTTP header.

 - Get the entire XML document as a string, set the Content-Length and let 
ZPublisher take care of it.

I have initially chosen the former as it seems to be the best use of memory 
resources for what could be an arbitrarily large data stream. However I 
wanted to make sure that I was clearing considering any disadvantages of not 
setting Content-Length.

tia,
/---------------------------------------------------\
  Casey Duncan, Sr. Web Developer
  National Legal Aid and Defender Association
  c.duncan@nlada.org
\---------------------------------------------------/