Okay, I know it sounds generic. But I mean on an AJAX level. I’ve tried using Firebug to track the NET connections and posts and it’s a mystery. Does anyone know how they do the instant autosave constantly without DESTROYING the network / browser?
Share
My guess (and this is only a guess) is that google uses a PUSH service. This seems like the most viable option given their chat client (which is also integrated within the window) also uses this to delivery “real time” messages with minimal latency.
I’m betting they have a whole setup that manages everything connection related and send flags to trigger specific elements. You won’t see connection trigers because the initial page visit establishes the connection then just hangs on the entire duration you have the page open. e.g.
Example of, how I see, a typical communication:
Where the
DOC_FETCHcommand is saying I want the data. The server replies with the correspondingDOC_CONTENT <docname> <length> <contents>. Then the client triggersDOC_AUTOSAVE <docname> <length> <content>. Given the number of potential simultaneous requests, I would bet they keep the “context” in the requests/responses so after something is sent it can be matched up. In this example, it knows theIM_OKmatches the second request (IM), and theAUTOSAVE_OKmatches the first request (AUTOSAVE)–Something like how AOL’s IM protocol works.Again, this is only a guess.
—
To prove this, use something like ethereal and see if you can see the information transferring in the background.