Consider, several customers are utilizing my Java Application. I'm using Http Common Apache to obtainOrPublish from the Http Server to obtain various user data.
There's a module within this client Application which triggers current Page no. from the Document (user1 opened up). I would like other Customers(User2, User3,....UserN) to understand the Page no. User1 opened up.
Really should customers listen/query the HTTP server currently interval always ? It is not recommended.
How do i implement this to ensure that Strain on server is reduced.
Lengthy Polling: Clients open an association together with your server and also the server transmits response only if user1 has transformed the page (Thinking about your example). This works great if the amount of clients for the programs aren't huge.
User Query: If dynamic update of page number in your application isn't a hard requirement, querying the page number is a wise decision by supplying a hyperlink will be a wise decision. This can enhance the server performance.
You should utilize Comet (lengthy-polling) inside your server application to prevent periodic polling. J2EE 6 will support it. Developing with Comet and Java describes steps to make it in J2EE 5.
Another server-side platforms aren't perfect for Comet (for instance PHP).