473,320 Members | 1,953 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Refreshing only updated images using php.

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?
Jul 17 '05 #1
3 2030
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, 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?


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...
Jul 17 '05 #2
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/
Jul 17 '05 #3
neur0maniak <us****@neur0maniak.co.uk> wrote in message news:<40***********************@ptn-nntp-reader04.plus.net>...
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, 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?


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...

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.
Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Bernard André | last post by:
Hi All, context: I am using Access 97 tablkes with VB. I can see records in the MDB, using Adodc and datagrid. No problem. But when doing: rsprivate.AddNew rsprivate!For =...
3
by: John Ortt | last post by:
I appologise for reposting this but I have been trying to find a solution all week with no avail and I was hoping a repost might help somebody more knowledgable than myself to spot the message... ...
1
by: xxnonexnonexx | last post by:
I use the following piece of code to show when the page thats being accessed was last updated: <!-- var modified = new Date(document.lastModified); document.write("<b>Last Updated:<i>...
2
by: jdi | last post by:
Hello, I have a seemingly basic question about ASP.NET. I would like to create a page containing an image, which keeps swapping the url of the image source, without refreshing the entire page. ...
0
by: Jeronimo Bertran | last post by:
Hi, I have a page that includes an image that uses an image map. When the user clicks on a button, the image needs to be refreshed and the map needs to be updated without refreshing the entire...
2
by: stevemtno | last post by:
I've got a problem with a web page I'm working on. I have 4 modules - one of them has 2 tabs, two of them have 4 tabs. When the user clicks on the tabs, the content below them changes. However, when...
5
by: handoyo | last post by:
Hi all,i'm trying to show updated data in existing html td.. For example i got column that show last modified datetime,then i want to update data again,the column will changed to current time without...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.