[lug] Web based streaming updates - how to get started?

Sean Reifschneider jafo at tummy.com
Fri Jan 24 04:39:44 MST 2003


On Wed, Jan 22, 2003 at 02:22:52PM -0600, Michael J. Hammel wrote:
>I have a project at work where I need to launch an application via a CGI
>script/program and have that application send multiple "status" updates
>back to the script/program.  I've done a modest amount of web

Well, the easy way is to do what is called "multi-part responses".  If
you are familiar with MIME multi-part e-mail messages, you can do
something similar with web-pages.  Every part that you output writes
over the previous part.  This is commonly used for making "webcams' that
update.  I use it on the shagginwagen.com page for a page that includes
my location, speed, direction of travel and a map of where I am (when
I'm driving around).

That's the good news...  The bad news is that IE doesn't support
multi-part responses.  The Mozilla camp does...

The *REALLY* nice thing about multi-part is that you can push each part
as new data becomes available, and keep the channel idle otherwise.  So,
as soon as the update is ready, the server can push it out to the
client(s), but if things are idle for long periods the network is as
well.

Setting a refresh can let you have similar abilities, and WILL work in
IE, but you will *ONLY* get updates on that frequency, and will get them
wether something has changed or not.  So, you don't want to set the
refresh to 1 second, but you also don't want to set it to 10 hours
(probably).

If you need to work with IE, you'll probably have to get clever and use
a session and a refresh.

Sean
-- 
 I'd like an order of fries, a quarter-pounder with cheese,
 I love the light in your eyes, will you go out with me please.
Sean Reifschneider, Inimitably Superfluous <jafo at tummy.com>
tummy.com, ltd. - Linux Consulting since 1995.  Qmail, Python, SysAdmin



More information about the LUG mailing list