4

When you start typing out a google search, it lists a bunch of options to autocomplete your search. This made me wonder how that autocomplete works. Is there a cache stored somewhere in the browser? That seems inefficient to me, so does it actually send a request to Google? If so, are these unfinished search requests stored or logged anywhere like typical searches?

  • Track/save/stored/logged by whom? Your title and your body do not really match. – schroeder May 29 at 18:54
  • There is a really easy way to test the one part of your question: disconnect the network and enter a search – schroeder May 29 at 18:55
  • Tracked or stored anywhere. I guess what I'm really asking is if there is any difference in communication between a browser/server when you actually submit a search vs. getting autocompletion results. – Calvin Godfrey May 29 at 18:55
  • Assuming you have the feature turned on...actually submitting a search will store that search completion (your account-bound copy of which you can later delete) – DarkMatter May 29 at 18:57
  • @DarkMatter the question is about unsubmitted entries – schroeder May 29 at 18:59
7

As inefficient as it sounds, that's exactly how it works.

Head on over to google.com, bring up your developer tools in your browser (CTRL+SHIFT+I or CTRL+OPTION+I in Chrome), click the network tab, and then start typing in the search box. You'll see a series of GET requests to to the /complete/search url path, like this:

https://www.google.com/complete/search?client=psy-ab&q=he
https://www.google.com/complete/search?client=psy-ab&q=hel
https://www.google.com/complete/search?client=psy-ab&q=hell
https://www.google.com/complete/search?client=psy-ab&q=hello

You'll probably have a bunch of other query parameters in there, but the client identifier and the query are the two required ones. The return from that request contains the autocomplete list for the substring you typed.

This means that autocomplete queries follow the same storage rules as not-autocomplete queries; if you have a proxy or cache or whatever, they'd appear there.

There's a couple of special rules at play, though: since they're XHR queries sent in the background rather than queries you type into the URL bar, the browser doesn't put them in your navigation history. And (IIRC) Google only uses this feature if you're on TLS, so it won't ever send these queries over plain text. And finally, since Google knows that they're autocomplete requests instead of actual searches, they don't appear in your stored search history associated with your account.

In terms of efficiency, this is why Google is investing so much in protocols like SPDY and QUIC (variations of which are now being standardized as HTTP/2 and HTTP/3). These allow extremely low-overhead HTTP traffic, getting it down to as low as one UDP packet in each direction for one of these autocomplete requests.

0

Is there a cache stored somewhere in the browser?

This is really easy to test: enter a search term in the search bar, then disconnect the network and try the same search term.

I just tried this to confirm again, and there is no autocomplete without a network.

Every character you type is sent to Google to auto-suggest completions.

If so, are these unfinished search requests stored or logged anywhere like typical searches?

We can only go with what is publicly disclosed to us. We cannot know what might be done on the backend. As for what is publicly disclosed, if you go into your Google account and look up the stored search data, only the submitted searches are stored.

From a practical point of view, it makes sense that only submitted searches are logged for any amount of time. That's the only data that will have any long term value. There is potential that unsubmitted queries are logged temporarily to improve the auto-suggest features in the short term.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.