Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Refreshing only updated images using php.

0 views
Skip to first unread message

Stokesy

unread,
Jul 18, 2004, 3:46:14 AM7/18/04
to
I am running a web page that has multiple web cams.
The users are given ftp accounts to upload their web cam images every
30 seconds.

What I want to do is instead of having the "refresh" in the header to
re-load the entire page from the server every 30 seconds, is to have
it re-load only the images that have been updated in the last 30
seconds. This is to cut down on wasted bandwidth.

I was thinking of giving each webcam picture its own i-frame, and
somehow getting the php to reload the frames containing the images
that have recent file modifycation dates.

Anyone have any ideas?

neur0maniak

unread,
Jul 18, 2004, 10:00:58 AM7/18/04
to
Stokesy wrote:

when you refresh the page, each image should have a querystring attached
, with the unix time of when it was last updated. This means that
browsers should cache the pictures that haven't changed and not bother
to download them. But there's no predicting what people have what
settings on their browser cache...

Brian

unread,
Jul 18, 2004, 10:30:06 AM7/18/04
to
Stokesy wrote:

> I am running a web page that has multiple web cams. The users are
> given ftp accounts to upload their web cam images every 30 seconds.
>
> What I want to do is instead of having the "refresh" in the header
> to re-load the entire page from the server every 30 seconds,

Not a robust solution, since the HTTP protocol does not have a
"refresh" header.

> is to have it re-load only the images that have been updated in the
> last 30 seconds. This is to cut down on wasted bandwidth.

Caching is the first thing you should be looking at. Is your server
sending "Last-Modified" headers? Is it processing "If-Modified-Since"
headers from the client?

> I was thinking of giving each webcam picture its own i-frame,

That sounds rather complicated.

> and somehow getting the php to reload the frames containing the
> images that have recent file modifycation dates.

PHP is a scripting language; it can't add new features to HTTP. In any
case, if each user changes one image from the page every 30 seconds,
I'm not sure what you can gain from uploading the page one frame at a
time.

--
Brian (remove ".invalid" to email me)
http://www.tsmchughs.com/

Stokesy

unread,
Jul 19, 2004, 3:55:16 AM7/19/04
to
neur0maniak <use...@neur0maniak.co.uk> wrote in message news:<40fa82b2$0$39766$ed2e...@ptn-nntp-reader04.plus.net>...


Its strange, if I make a form submit button that just points to
itself, and i click that, only the updated images load, but if i put a
refresh header in the html or php, when it reloads, it loads every
picture off the server again regardless.

0 new messages