Is there a Push feature for Coldfusion to create a live ticker?
We run a contest on our website where visitors can vote on their favorite contest entry. We get a lot of traffic and a lot of votes.
We would like to add a ticker to our homepage that is updated live when a vote is cast to show the total number of votes.
Our site is powered by Coldfusion 10 server.
The only way I know how to do this is to run a JavaScript function that runs every second or so, and that will run an ajax command to call another page, which just fires a request to get the general vote back. It looks like it would eat up a lot of bandwidth when you do hundreds of user surveys every second.
Is there a better way that doesn't result in huge dragging of the strip? Is there some Coldfusion "push" function that can be used?
source to share
This is the most walk-through and complete tutorial I have used on the subject. Guides you through everything.
http://www.adobe.com/devnet/coldfusion/articles/html5-websockets-coldfusion-pt1.html
Plus, they never touch to make sure the port is open on your server. We are a WIN 2008 Server user and by default the firewall blocks it.
At its most basic level, you do three things:
- Add the channel to your App.cfc
- Add a listener on the page where you are going to use the data (listen to the channel)
- Add a page for publishing data (post to channel)
There are many other things you can do to process the data at each step.
source to share