Why are service workers so great for web performance?

Five Questions for Max Firtman: Thoughts on the offline web, service workers, and the future of mobile performance.

By Brian Anderson and Max Firtman
September 1, 2016
Towers on hill Towers on hill (source: Hans via Pixabay)

Max Firtman, mobile web developer, speaker, trainer, and author, is giving a tutorial on “Service workers and push notifications for web performance” at Velocity New York in September. We recently sat down to discuss mobile web performance and innovations. Here are some highlights from our talk.

What is the “offline web” and why is it so important?

The offline web involves a couple of techniques to make our websites and web apps available when on flaky connections as well as when no connection is available. It’s one of the foundations of progressive web apps, and it’s also important when you have a good connection as you can deliver the app shell—the necessary code to render the UI—immediately.

Learn faster. Dig deeper. See farther.

Join the O'Reilly online learning platform. Get a free trial today and find answers on the fly, or master something new and useful.

Learn more

What are the benefits of using service workers? What are the challenges in utilizing them effectively?

Service workers and the cache storage sub-API allow us to render our website immediately—as a native app—and also let us cache dynamic content with our own rules. In terms of challenges, debugging and understanding all the options available for caching is what is worth mentioning.

What’s the most important thing that people should know when optimizing applications for the mobile web?

That even on 4G, which not everybody is using, we have four times more latency than on home wired connections, so browsing on a mobile device is always a challenge. Also, we need to not underestimate mobile browsers, testing on real devices on real networks and not just relying on a desktop browser that we resize.

What are some exciting projects / trends you are seeing in the world of mobile performance?

HTTP/2 and HTTP Client Hints are new solutions that will help web performance for mobile devices, as well as new compression algorithms and encodings such as brotli and zopfli that can send more content in the same compressed package, making the mobile web more performant. Finally, new image formats (from WebP and JPEG XR to FLIF) will change how we deliver images on the Web.

You’re speaking at the Velocity Conference in New York this September. What presentations are you looking forward to attending while there?

Velocity is always interesting. Hearing from top companies about their experiences is always refreshing. I’m looking forward to attending the presentations on AMP and HTTP/2, two of the new technologies in the mobile web space that may help mobile web performance.

Post topics: Performance