...

Polling

spetsacdc
07-24-2008, 07:18 AM
Hi,

I need to use ajax polling to update a page as soon as a value in the mysql database is changed. The polling will only happen on one page of the website and only like 1-10 people have access to the page at a time. Ideally, the ajax would call the php function every second, but does that strain the server any? I could live with like 20-30 second intervals if needed. Also, I read an article on long polling (comet) vs. regular. Does my situation call for long or regular? Regular seems easy to set up with jQuery.

Thanks :)

rnd me
07-24-2008, 08:14 AM
comet is still very complicated to implement.


if you can build a static page everytime the db is updated, it will be far easier on your server. you can use simple HEAD requests to espablish when the data changed, saving the download of a file every second. heads usually bounce back in one packet.

you can run head every 5 seconds, and immed DL if the data changed.

ohgod
07-24-2008, 02:44 PM
http://www.prototypejs.org/api/ajax/periodicalUpdater

super easy to set up and configure and even has an optional decay feature built in.

spetsacdc
07-24-2008, 04:18 PM
Thanks, I guess I'll use like a 10 second interval. Also, I life jquery more than prototype, so I'm going to search for one of those plugins.


Thanks



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum