Over the last decade we've changed how we design websites to be mobile-first. But until recently we haven't really been able to do much about poor network connectivity.
As part of support for "progressive web apps", browsers are now starting to include technology that gives developers control of how they handle network requests. By tapping into this we open up all sorts of possibilities - caching things in advance, showing stale content while refreshing in the background, or just keep our users a bit more informed. We can enhance our sites to work better under sub-par network conditions.
This talk will give an introduction to the service worker, fetch and cache APIs. I'll aim to highlight what they do and how you might use them, without going into too much technical detail.
We'll look at some of things we need to consider when providing offline functionality:
- what can we realistically expect to work offline?
- caching isn't one size fits all - different resources require different strategies; these vary according to business and technical reasons
- does it matter if we show stale content?
There's an expectation that native apps are better at working offline. But they often present the same information as on the web, downloaded over the same fallible network. We can draw on the experience of app developers to answer some of these questions.
We'll take an example Drupal site and consider how we might improve it for people with sketchy or non-existent mobile signal or wifi.
Some notes to accompany this talk are available