• Post Reply Bookmark Topic Watch Topic
  • New Topic

gmail auto update

 
David Spades
Ranch Hand
Posts: 348
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, I've seen in google mail that the webpage will automatically update whenever a new mail arrives without the user manually refresh the gmail webpage. I'm curious how this is done. Is it polling? or is it something else? how is this done in java web app? thanks
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35704
407
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know of two ways to do it.

1) "Regular" Ajax polling
2) Comet - for push notifications

I know gmail chat uses Comet. I'm not sure whether the email part does.
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or, if your targeted browsers and your servlet container -at least Tomcat 7- support it, use Server-sent events.
 
David Spades
Ranch Hand
Posts: 348
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
any good book I can read about comet or server-sent events? I dont think polling is very efficient since it would flood the server if there are a lot of users. thanks
 
Paul Clapham
Sheriff
Posts: 21862
36
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have GMail open in one of my browser tabs, and I can tell you (because I ran a plugin which examines all of my browser's requests and responses) that it sends periodic requests to Google servers.

You may think that would flood the server, but then you might also think that millions of people world-wide doing Google searches would flood the server too. But since Google has several thousand servers it probably doesn't matter.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!