24: ServiceWorkers and High Performance Offline Apps
Offline access for applications is becoming more and more necessary for web development today due to increasing client usability demands. The HTML AppCache are a partial solution but is very sticky, often provides stale data and is not dynamic or adaptable. Developers can easily find themselves doing hacks with the deprecated Web SQL API, IndexedDB, & localStorage or a framework like Hood.ie to achieve a fully supported offline application.
Jake Archibald (@jaffathecake), Google software engineer, wrote an infamous article on A List Apart about the inadequacies of AppCache. This turned into the beginnings of ServiceWorker, an API for offline access that provides “scriptable primitives that make it possible for application developers to build URL-friendly, always-available applications in a sane and layered way.” ServiceWorkers allow developers to to make sites work faster and/or offline and also use network intercepting as a basis for other 'background' features such as push messaging and background sync
Jake, along with Google Engineer, Alex Russell (@slightlylate) & Mozilla engineers Anne Van Kesteren (@annevk) & Ben Kelly (@wanderview) talk about ServiceWorker’s current state and how we will use it in our applications.
Resources-
The spec - https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html
-
How to build with ServiceWorkers - https://github.com/slightlyoff/ServiceWorker/blob/master/explainer.md
-
The Offline Cookbook - http://jakearchibald.com/2014/offline-cookbook/
-
ServiceWorker Cache Polyfill - https://github.com/coonsta/cache-polyfill
-
ServiceWorker Github - https://github.com/slightlyoff/ServiceWorker
-
The article that started it all - http://alistapart.com/article/application-cache-is-a-douchebag
-
Offline First Organization - http://offlinefirst.org/
-
Potential Resource Implications - https://hacks.mozilla.org/2014/12/mozilla-and-web-components/
-
Understanding ServiceWorker Cache in Firefox - http://blog.wanderview.com/blog/2014/12/08/implementing-the-serviceworker-cache-api-in-gecko/
-
Intro to Service Worker - http://www.html5rocks.com/en/tutorials/service-worker/introduction/
-
Using Service Workers - https://developer.mozilla.org/en-US/docs/Web/API/ServiceWorker_API/Using_Service_Workers
-
Web Spec Framework - https://github.com/slightlyoff/web-spec-framework
-
Brendan Eich Quote - https://annevankesteren.nl/2014/09/tc39-api-design
-
The early state of ServiceWorker - http://devchat.tv/js-jabber/069-jsj-the-application-cache-with-jake-archibald
Support in browsers - https://jakearchibald.github.io/isserviceworkerready/