For several days, I experimented with a long poll / comet implementation for my site. I got the basic idea of ββhow this works, this is where I run a few tests .
On the other hand, I watched (firebug) how gmail and facebook use a lengthy poll. What I noticed in gmail is that the ajax request does not follow immediately after the current request expires, but it waits a few seconds / minutes before it starts the next one.
I played with him a little more. I tried logging in with a gmail account in Firefox and in a gmail account in Chrome. I was waiting for the current ajax poll to complete, and then I sent an email from account B to A. I expected account A to not receive it until the next poll, but to my surprise, account A directly received it right after that send button.
How does gmail do this with a long survey?
If you try to visit my site and click on the "Run" button and open firebug, you will see that ajax spinner always works. when the server responds with data, it again requests the server.
source share