Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Service Workers: no more offline!
1. Service Workers: no more offline!
Maciej Adamczak
meet.js Lublin | 11-02-2015
2. about:me
• Senior Front-End Developer
• 7+ years of Web Development
experience
• AngularJS Developer
• Automatization enthusiast
• Fan of web based mobile apps
• Privately a runner, reader addict and
cooking lover
2
3. Agenda
• Offline
• What is ServiceWorker?
• Service Worker Standard
• What for and why…?
• API
• Usage examples
• Can I use?
• No more offline?
• Summary
3
4. Offline (mobile)
Lack of the connectivity with network
while using either wireless connection
or while being connected to device
with internet access.
• Mobile Internet (GPRS, Edge, 3G, HSDPA, LTE)
• Wi-Fi
• Bluetooth
• other
4
5. What is Service Worker?
• A client-side proxy server with programmatic API
• Allows to intercept network requests
• Runs in a background (own browser thread)
• Supports only HTTPS requests
• In the future will be integrated with Push Notification
and Background Sync APIs
5
18. Service Worker
• Works like a Web Worker
• Requires installation and activation before
first use
• Can use Cache and CacheStorage APIs
• Intercepts any HTTPS request
18
30. Can I use?
30
• Chrome 40 (released)
– Both dekstop and mobile (android) based browsers
• Firefox Nightly
– Partial support, requires enabling on about:config
• Internet Explorer
– Under consideration :(
• Safari
– Unknown :(
• Opera 27
– Jus like Chrome
Cache and CacheStorage is a servicer worker. Handels API for storing Response, deleting, updating, matching URL of resource etc.
The Fetch standard defines requests, responses, and the process that binds them; fetching.
Mode ex. CORS, Method: HEAD, OPTIONS, POST, GET
Promises based (XHR, Async)
https://developer.mozilla.org/en-US/docs/Web/API/Cache
https://developer.mozilla.org/en-US/docs/Web/API/CacheStorage