Gmail Felt Instant Because It Stopped Reloading the Page
A little-used browser feature let it ask for just the new message, not a whole new page.

Standard Capital · How Paul Buchheit Created GmailBefore Gmail, email in a browser felt slow for a simple reason. Every click reloaded the entire page, including all the parts that had not changed.
Paul Buchheit, the engineer who built Gmail at Google, started in 2001 with a simple email search tool. Inside Google, speed was a core demand, so he looked for ways to avoid those full trips back to the server.
The answer was to have the page talk to the server quietly, behind the scenes. Instead of asking for a whole new page, the browser could ask for just the new data and slip it into the page already on screen.
The tool that made that possible was called XMLHttpRequest. It was a little used feature in the browser that let a page contact a server without reloading. Buchheit said he investigated several ways to do this, and XMLHttpRequest turned out best, with hidden iframes and image tags as other options.
The name was misleading. Although it said XML, a popular but wordy data format at the time, Gmail did not send XML. To keep every exchange small, Buchheit sent compact JavaScript arrays, lists of values the browser could read immediately.
Fetching only what was new, and keeping those messages as small as possible, is what made Gmail fast.
Questions people ask
What exactly is XMLHttpRequest?
It is a built-in browser feature that lets a web page ask a server for data without reloading. The page keeps working while it waits, then updates only the part that changed, like showing a new email.
Why was sending arrays faster than sending XML?
XML uses opening and closing labels around every piece of data, which makes files large. Arrays and JSON list just the values in order, so the same information travels in much less text and loads faster.
Do modern websites still work this way?
Almost all of them do. Inbox updates, maps, social feeds, and search suggestions use the same idea: fetch a small piece of data in the background and insert it into the page you are already viewing.
