Google Search Starts Using 'Service Worker' To Speed Up Repeated Searches

Speed matter on the web. Google as one of most famous on the web, knows and is obsessed with it.

Google Search is the most visited place on the internet, where users can type in anything they want and leave Google the rest to answer their queries. It's also one of the fastest loading service on the internet. Since user experience has been one of Google's primary focus, the company wants the search engine to become even faster.

To do this, the search engine uses 'Service Workers' to cache repeated searchers.

Service Worker is an API for running background scripts in users browser. This way, Google can speed repeated searches to up to two times as fast, because it doesn't have to go back and forth to fetch data to populate its search results pages.

The news was shared by Dion Almaer, Google director of engineering, and Ben Galbraith, Google senior director of product.

Service Worker
Service Worker is a script that runs in the background, separate from a web page, opening the door to features that don't need a web page or user interaction

The two directors have spent the majority of their time talking about modern web technologies, including AMP, Service Worker, and WebAssembly.

"Google Search’s mission is to get relevant results to you as quickly as possible," said Almaer. "So they invested in the largest deployment of Service Worker probably out there by being able to extra work on the fly and give you results sometimes twice as fast."

Speeding up Google Search with the 2x figure is certainly a substantial improvement. However, it comes with one caveat: Service Worker is only being used in Chrome for Android, specifically version 62 and up.

"Service Worker has been available for several years now, but for Search’s requirements — we’ve been continually optimizing implementations of Service Worker and also waiting for broader coverage as well," explained Galbraith to VentureBeat.

Google can only use Service Workers on Android because other major browsers at the time of the announcement, haven't support Navigation Preload, a latency optimization that is critical for Google Search to run Service Workers.

By the time other browsers start supporting it, the team at Google Search will expand the repeated search improvement to them as well.

Service Worker - Navigation Preload
Navigation Preload allows Chrome to make a request in parallel with Service Worker boot-up, reducing latency

Navigation Preload support was added to Chrome since version 59 in 2017. Then comes the question: what took Google so long?

"A lot of it is to do with optimizing the Service Worker pipeline, how quickly can it start up and do its thing, networking stack — low-level stuff,” said Almaer. "Given how finely tuned Search is, there was just a lot of work with the team to really optimize all those powerful ways to give it a bigger bang for buck."

"Google Search is one of the biggest sites in the world. Having them use Service Worker is something that we’ve hoped to see on the platform side for a while," Galbrieth explained. "This is one of many features that they’ve been working on. As they roll it out … we wouldn’t roll out anything at Google that would be a step backwards for latency or cause any issues — as you can imagine it has to be stable. So we view it as confirmation that Service Worker is ready for prime time."

Google has been obsessed with speed, and Search is constantly improving its ability to deliver answers to people's queries. So the search engine in using Service Workers to speed itself up shouldn't be a surprise as Google is always on the move seeking new ways to improve things.

Published: 
05/09/2018