[Zope-dev] Streaming Response

Johan Carlsson [EasyPublisher] johanc@easypublisher.com
Wed, 16 Apr 2003 06:26:09 +0000


At 14:26 2003-04-15 -0700, Brett Carter said:
> > What doesn't work in IE? Am I missing something?
>HTTP Push (Client Push, Client streaming, etc) is a client based protocol,
>and IE browsers don't support it - they don't recognize the content type, so
>they'll just pop up a 'Download this file box'

Ok.

>
> > I tried the Python Script bellow with the same behavior in both
> > IE (IE6) and Mozilla (each paragraph was written in intervals I don't
> > now how to do a sleep in Python Scripts so I use a for loop
> > that I trimmed to produce measurable intervals on my server
> > (a rather slow machine)).
>
>I'm not sure what you're trying to do - most browsers require the full
>content of the page to be downloaded before they display it, iirc.
>-Brett

Well, do they? Most browsers try to show content as fast as possible.
There are even CSS-standards for making it possible to predict a tables
layout ahead to be able to render it as fast as possible (before it is 
completely loaded).
The main reason of this I guess is because people usually start reading the 
top of the
page and showing it make it appear to load faster for the visitor.
Hence, your browser/site appears faster.

My tests shows that both Moz and IE shows content sent so far even if
the session has not finished or the file is completely transmitted.
(I got the feeling that this was the intended behavior in the original 
question (?))

Also interfaced gif images are shown as soon as possible, I guess movie clips
and flash movies also behave that way.

This could be useful for other stuff as well (except streaming large object,
which should never be saved in the ZODB by the way, be cause it bloats the
memory when the object is loaded. It should be stream from a file, and not
by reading the entire file as most file system object product I reviewed does
including LocalFS which I have made a patch for).

One use would be sending response in a long-time execution of a pack
or other maintenance activities. It's a great thing to see how the process
get along and that it's not halted.

In such a process you can't predict the Content-Length, because you
don't know ahead what messages the might pop-up.

So the question is what happens if the Content-Length is excluded.
In my test with text/html content nothing happens and it works fine.
Other content types may behave differently depending on the client.

Regards,
Johan Carlsson


-- 
Easy Publisher Developers Team
Johan Carlsson
johanc@easypublisher.com

Mail:
Birkagatan 9
SE-113 36  Stockholm
Sweden

Phone +46-(0)8-31 24 94
Fax +46-(0)8-673 04 44
Mobil +46-(0)70-558 25 24
http://www.easypublisher.com