1

I'm working on a tool that will require 'listening' for a response from the server.

Currently I've got the page using JQuery to request a URL and respond based on it's output.

I do that every couple seconds.

However, as there will likely be hundreds of people using the tool all at the same time, that could be a pretty big server load.

Is there a way I can create a 'listener' that will notify the loaded pages when a change happens instead of constantly querying the server?

I haven't really been able to find much on Google (probably not searching for the correct thing) so hopefully someone here will know exactly what I'm talking about.

Thanks in advance for your quick responses!

user1146223
  • 209
  • 4
  • 14
  • 1
    You'll probably want something like a comet or web sockets – Jibi Abraham Sep 29 '12 at 15:34
  • socket io, web sockets. Node.js. CORS, postMessage. – King Friday Sep 29 '12 at 15:41
  • Comet/server push is what you want here, but if you can't install that for some reason, don't forget that you can and should take advantage of caching and conditional headers (ETag and/or Last Modified) to reduce the amount of time servers need to spend on requests for stale data. – Platinum Azure Sep 29 '12 at 15:41

1 Answers1

0

You are looking for technologies named Comet or server push. There are several different implementations of this problem, typically involving long-running, but idle HTTP connections. Check out Atmosphere (in Java) or various other libraries.

Also make sure to have a look at web sockets (new HTML5 technology).

See also

Community
  • 1
  • 1
Tomasz Nurkiewicz
  • 334,321
  • 69
  • 703
  • 674