AFAIK you cannot allow the server to click on clients via HTTP on the server event (maybe I'm wrong here), you can use the SPDY protocol if your clients support it (I think only the Chrome browser).
So, the only thing you can do is check if the last entry matches the same as in pageload. You must check with the server every X seconds / minutes.
You can achieve this by doing something like this:
- with pagerequest, save the identifier of the last entry somewhere on the page (for example, hidden input).
- Write a small server-side script to return only the identifier of the last record (simple)
- Compare them with the client, if they do not match, complete the full ajax request for new content.
The only thing the server needs to do (every X with per client) is query the database for the last record and display it on the screen. You can also check the server (more load on the server) or output it via JSON (also more load on the server).
I do not think you can do this without these checks.
source share