How do most apps "check for updates". i.e. gmail, "shoutboxes", etc. etc.

My guess is, request the page every second or something but that seems like it would take a long time, and of course the page would then have to query the database for new data?

So, if that isn't how it's done... how is it? Are there frameworks designed more specifically for this sort of thing?