Web Directions

Conffab

  • Speakers
  • Presentations
  • Conferences
  • Organizers
  • Topics
  • Pricing & Plans
  • Browse
  • Signup
  • Sign In
  • Speakers
  • Presentations
  • Conferences
  • Organizers
  • Topics
  • Pricing & Plans
  • Browse
  • Signup
  • Sign In
Advanced Search
Searching videos

Getting Offline with the Service Worker

Chris Roberts at Code 2015
Sign up for Conffab Free to watch this and hundreds of other videos for free
  • Details
  • Keypoints

As the web is increasingly accessible in more places, so is the fragility of the connection. In this presentation together we will learn about how to progressively enhance the delivery of content with the Service Worker API.

We will cover the notion of offline first as well as a take-away introduction to the Service Worker API through a practical example and demonstration of the code and tools you can use to create an offline experience for your users.

Australia is still a very disconnected country. We have large areas with no data network. So Chris’s example of needing to check a hotel booking on a plane is pretty common and will be a massive issue for many regions as they start getting online.

Expedia’s site stores the user’s most recently accessed information, as it’s likely they will want it again.

Offline First: the next progressive enhancement technique. “Or perhaps it should be ‘unreliable connection first’…”

Don’t think of offline as an error situation – we have responsibility to handle the case. Time will not solve this problem – as time goes on, we won’t suddenly have 100% of people on great connections. As time goes on people connect in more and more different ways.

Offline strategies:

  • reduce reliance on the server
  • sync when possible – make use of good connections
  • gracefully resolve conflicts
  • query device APIs

Great person to follow on this stuff is Jake Archibald. Also check out his book the “offline cookbook” from 2014 (on his website).

Service worker life cycle:

  • registration
  • installation/cache open
  • proxy the network
  • termination

Browser support:

  • Chrome and Opera yes, now!
  • Firefox soon
  • IE under consideration for Edge
  • Safari no

(John Allsopp notes afterwards – a great way to influence browser vendors is to use things and show the need and demand. Also as this is an enhancement you don’t have to wait for full coverage to start giving the benefit to people who can use it.)

Q&A

Q: do any frameworks have good support for service workers?

A: there are some, but in the meantime work on identifying the shell of your app that you should be serving while offline.

Q: any restrictions on what or how much you can cache?

A: pretty much any http request can be handled; noting CORS impacts

You may also be interested in

Thumbnail for Once More with Feeling

Once More with Feeling

Tim Kadlec

Thumbnail for CSS Grid Layout

CSS Grid Layout

Rachel Andrew

Thumbnail for Flexing Your Layout Muscles – A Pragmatic Look at Flexbox

Flexing Your Layout Muscles – A Pragmatic Look at Flexbox

Stephanie Rewis

Thumbnail for The Power and Responsibility of Unicode Adoption

The Power and Responsibility of Unicode Adoption

Katie McLaughlin

Thumbnail for Does Your Web App Speak Schadenfreude?

Does Your Web App Speak Schadenfreude?

Greg Rewis

Thumbnail for CSS: Code Smell Sanitation

CSS: Code Smell Sanitation

Fiona Chan

Thumbnail for Zen of JavaScript

Zen of JavaScript

Dmitry Baranovskiy

Thumbnail for Progressing Your Web Apps With Service Worker

Progressing Your Web Apps With Service Worker

Marcos Caceres

More presentations from Code 2015

    Thumbnail for The State of the Animation

    The State of the Animation

    Rachel Nabors

    Thumbnail for What Comes Next for the Web Platform?

    What Comes Next for the Web Platform?

    Alex Russell

    Thumbnail for Async and Await

    Async and Await

    James Hunter

    Thumbnail for Async Frontiers in JavaScript

    Async Frontiers in JavaScript

    Domenic Denicola

    Thumbnail for Classing up ES6

    Classing up ES6

    Andy Sharman

    Thumbnail for Canvas Cold War

    Canvas Cold War

    Simon Swain

    Thumbnail for Current Best Practice in Front End Ops

    Current Best Practice in Front End Ops

    Alex Sexton

    Thumbnail for Stop the Fanaticism – Using the Right Tools for the Job

    Stop the Fanaticism – Using the Right Tools for the Job

    Kassandra Perch

Conffab
  • About
  • Speakers
  • Presentations
  • Conferences
  • Contact
  • Sign in
Sign Up

© Conffab 2025