SlideShare a Scribd company logo
1 of 26
Download to read offline
Service Workers 
Bring your own magic
Jungkee Song 
Github: https://github.com/jungkees 
Twitter: @jungkees 
Google+: +JungkeeSong 
Facebook: https://www.facebook.com/jungkees 
See the animated version here!
Service Workers solve … 
Offline Usage 
Offline-first 
Sorry, no magic. Create your own! 
Programmable cache control 
Write your own HTTP request proxy 
Background Processing 
Wanna do things while your browser is not running? 
Push messages, System alarm, BackgroundSync …
Standard 
W3C first published working draft
Standard 
Please check out the editors draft! 
https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html 
https://github.com/slightlyoff/ServiceWorker
Principles and terms 
Runs on same origin 
Registration keyed by URL scope 
Document is controlled by matching SW upon navigation 
Installed worker is considered worker in waiting 
Lifecycle events: install, activate 
Functional events: fetch and more to come
Are you online? 
Page 
Navigation/Resource request 
Network fetch 
Response
Are you sufficiently online? 
Page 
Navigation/Resource request 
Network fetch 
4XX 
5XX 
Timeout 
DNS failure
Offline-first 
Have a Service Worker? 
fetch event 
Navigation/Resource request 
onfetch 
Page 
SW 
e.respondWith! 
(Promise<response>) 
Promise<response> 
Cache self.caches.match(url) 
IDB 
new Response({! 
status: 200,! 
body: { … }! 
})
Offline-first 
Fallback to network with SW 
fetch event 
Navigation/Resource request 
onfetch 
Page 
SW 
Cache 
self.fetch(request) 
e.respondWith! 
(Promise<response>) 
Promise rejects 
self.caches.match(url)
Event-driven worker 
Browsers are allowed to kill SW at any time 
Page Page 
fetch event 
Navigation/Resource request 
Navigation/Resource request 
onfetch 
Page 
SW 
e.respondWith! 
(Promise<response>) 
Promise<response> 
Cache self.caches.match(url) 
fetch event 
e.respondWith! 
(Promise<response>)
Registration 
In the page 
[ Registration map ] 
Scope Script URL 
“/” /assets/v1/serviceworker.js 
// scope defaults to "/" ! 
navigator.serviceWorker.register("/assets/v1/serviceworker.js").then(! 
function(registration) { ! 
console.log("success!"); ! 
registration.installing.postMessage(“Howdy from your installing page."); ! 
// To use the serviceWorker immediately, you might call! 
// window.location.reload() ! 
}, function(why) { ! 
console.error("Installing the worker failed!", why); ! 
});
Registration 
In the page 
[ Registration map ] 
Scope Script URL 
“/” sw.js 
“/foo/” /foo/sw.js 
navigator.serviceWorker.register("/sw.js"); 
/bar/sw.js 
navigator.serviceWorker.register("/foo/sw.js", { scope: “/foo/” }); 
navigator.serviceWorker.register("/bar/sw.js");
Installation 
Registration triggers installation of the SW 
Browser fires install event to the installing SW 
Event handlers may extend the lifetime of SW for preparing 
its caches
Installation: oninstall 
In the SW context 
// caching.js! 
this.addEventListener("install", function(e) {! 
e.waitUntil(! 
// Create a cache and add resources! 
caches.create(“shell-v1”).then(function(cache) {! 
cache.addAll([! 
"/app.html",! 
"/assets/v1/base.css",! 
"/assets/v1/app.js",! 
"/assets/v1/logo.png",! 
"/assets/v1/intro_video.webm"! 
])! 
})! 
);! 
});
Programmable cache control 
Via Cache / CacheStorage interfaces 
[Constructor]! 
interface Cache {! 
Promise<Response> ! 
match((Request or ScalarValueString) request, optional CacheQueryOptions options);! 
Promise<sequence<Response>> ! 
matchAll((Request or ScalarValueString) request, optional CacheQueryOptions options);! 
Promise<Response>! 
add((Request or ScalarValueString) request);! 
Promise<sequence<Response>> ! 
addAll(sequence<(Request or ScalarValueString)> requests);! 
Promise<Response>! 
put((Request or ScalarValueString) request, Response response);! 
Promise<boolean> ! 
delete((Request or ScalarValueString) request, optional CacheQueryOptions options);! 
Promise<sequence<Request>>! 
keys(optional (Request or ScalarValueString) request, optional CacheQueryOptions options);! 
}; 
caches.create(“myCache”).then(function(cache) { … })
Have a controller yet? 
Worker in waiting 
Once self.oninstall ends 
So to speak, the installation is successfully done 
Not yet controlling the document in scope 
navigator.serviceWorker.controller 
When all the documents in scope unload 
The worker in waiting becomes active worker 
event.replace() works
Handle a fetch: onfetch 
In the SW context 
this.addEventListener("fetch", function(e) {! 
// No "onfetch" events are dispatched to the ServiceWorker until it! 
// successfully installs.! 
! 
// All operations on caches are async, including matching URLs, so we use! 
// Promises heavily. e.respondWith() even takes Promises to enable this:! 
e.respondWith(! 
caches.match(e.request).catch(function() {! 
return e.default();! 
}).catch(function() {! 
return caches.match("/fallback.html");! 
})! 
);! 
});
Fetch: navigation request 
Document selects SW registration upon navigation 
Page Navigate to https://example.com/index.html 
[ Registration map ] 
Scope Script URL 
onfetch 
sw.js 
e.respondWith! 
(Promise<response>) 
Promise<response> 
Cacheself.caches.match(url) 
“/” /sw.js 
“/foo/” /foo/sw.js 
fetch event 
Scope matching 
Run SW
Subresource request 
Document uses selected SW registration for subresources 
[ Registration map ] 
Scope Script URL 
onfetch 
sw.js 
e.respondWith! 
(Promise<response>) 
Promise<response> 
Cache self.caches.match(url) 
“/” /sw.js 
“/foo/” /foo/sw.js 
Page 
Fetch “https://example.com/img/flower.png 
fetch event 
Control 
Run SW
Updating triggered by 
Registration 
Browser automatically 
Successful navigation matching 
API in worker context: self.update()
Updating 
Document uses selected SW registration for subresources 
[ Registration map ] 
Scope active 
onfetch 
sw-v2 
e.respondWith! 
(Promise<response>) 
Promise<response> 
Cache self.caches.match(url) 
“/” v1 
fetch event 
- 
waiting 
sw-v1 
[[Update]] 
[[Install]] 
Page 
sw-v1 /sw-v2 /-sw-v2 
Page 
v2 
Fetch “https://example.com/img/flower.png 
Run SW
Security 
Origin relativity 
Cross origin resource 
HTTPS-only 
Protect end users from man-in-the-middle attacks 
Existing playground services (e.g. github.io) now work 
with HTTPS 
HTTPS is coming across much more of the web quickly 
Devtools can loosen the restriction for development
Performance 
Event-driven workers 
Free to shutdown the worker when handler’s done 
Write your workers as though they will die after every 
request 
Keep the onactivate short 
Platform considerations 
Enhance matching navigation 
Events implicitly filter 
Enhance startup
Is it ready for you? 
Chrome 35+ 
Partial under flag 
chrome://flags/enable-service-worker 
Firefox nightly 
Under consideration 
IE 
Partial under flag 
about:config > dom.serviceWorkers.enabled 
Stay alerted! 
Jake’s “Is ServiceWorker ready?”
References and practices 
Service Worker - first draft published - Jake Archibald 
Specification 
Github’s explainer 
Github’s implementation considerations

More Related Content

What's hot

Instant and offline apps with Service Worker
Instant and offline apps with Service WorkerInstant and offline apps with Service Worker
Instant and offline apps with Service WorkerChang W. Doh
 
Service worker - Offline Web
Service worker - Offline WebService worker - Offline Web
Service worker - Offline WebBruno Oliveira
 
JQuery UK Service Workers Talk
JQuery UK Service Workers TalkJQuery UK Service Workers Talk
JQuery UK Service Workers TalkNatasha Rooney
 
JQuery UK February 2015: Service Workers On Vacay
JQuery UK February 2015: Service Workers On VacayJQuery UK February 2015: Service Workers On Vacay
JQuery UK February 2015: Service Workers On VacayNatasha Rooney
 
PWA 應用 - 實現網站離線瀏覽
PWA 應用 - 實現網站離線瀏覽PWA 應用 - 實現網站離線瀏覽
PWA 應用 - 實現網站離線瀏覽Anna Su
 
PWA Roadshow Seoul - HTTPS
PWA Roadshow Seoul - HTTPSPWA Roadshow Seoul - HTTPS
PWA Roadshow Seoul - HTTPSChang W. Doh
 
Building Offline Ready and Installable Web App
Building Offline Ready and Installable Web AppBuilding Offline Ready and Installable Web App
Building Offline Ready and Installable Web AppMuhammad Samu
 
Choosing a Javascript Framework
Choosing a Javascript FrameworkChoosing a Javascript Framework
Choosing a Javascript FrameworkAll Things Open
 
PWA Roadshow Korea - Service Worker
PWA Roadshow Korea - Service WorkerPWA Roadshow Korea - Service Worker
PWA Roadshow Korea - Service Workerjungkees
 
NLIT 2011: Chef & Capistrano
NLIT 2011: Chef & CapistranoNLIT 2011: Chef & Capistrano
NLIT 2011: Chef & Capistranonickblah
 
"Service Worker: Let Your Web App Feel Like a Native "
"Service Worker: Let Your Web App Feel Like a Native ""Service Worker: Let Your Web App Feel Like a Native "
"Service Worker: Let Your Web App Feel Like a Native "FDConf
 
Service workers and the role they play in modern day web apps
Service workers and the role they play in modern day web appsService workers and the role they play in modern day web apps
Service workers and the role they play in modern day web appsMukul Jain
 
Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7
Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7
Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7Max Andersen
 
Cool like a Frontend Developer: Grunt, RequireJS, Bower and other Tools
Cool like a Frontend Developer: Grunt, RequireJS, Bower and other ToolsCool like a Frontend Developer: Grunt, RequireJS, Bower and other Tools
Cool like a Frontend Developer: Grunt, RequireJS, Bower and other ToolsRyan Weaver
 
So I Wrote a Manifest
So I Wrote a ManifestSo I Wrote a Manifest
So I Wrote a ManifestPuppet
 
007. Redux middlewares
007. Redux middlewares007. Redux middlewares
007. Redux middlewaresBinh Quan Duc
 
Spring Booted, But... @JCConf 16', Taiwan
Spring Booted, But... @JCConf 16', TaiwanSpring Booted, But... @JCConf 16', Taiwan
Spring Booted, But... @JCConf 16', TaiwanPei-Tang Huang
 
Orchestration? You Don't Need Orchestration. What You Want is Choreography.
Orchestration? You Don't Need Orchestration. What You Want is Choreography.Orchestration? You Don't Need Orchestration. What You Want is Choreography.
Orchestration? You Don't Need Orchestration. What You Want is Choreography.Julian Dunn
 
Best Practices for creating WP REST API by Galkin Nikita
Best Practices for creating WP REST API by Galkin NikitaBest Practices for creating WP REST API by Galkin Nikita
Best Practices for creating WP REST API by Galkin NikitaWordCamp Kyiv
 

What's hot (20)

Instant and offline apps with Service Worker
Instant and offline apps with Service WorkerInstant and offline apps with Service Worker
Instant and offline apps with Service Worker
 
Service worker - Offline Web
Service worker - Offline WebService worker - Offline Web
Service worker - Offline Web
 
JQuery UK Service Workers Talk
JQuery UK Service Workers TalkJQuery UK Service Workers Talk
JQuery UK Service Workers Talk
 
JQuery UK February 2015: Service Workers On Vacay
JQuery UK February 2015: Service Workers On VacayJQuery UK February 2015: Service Workers On Vacay
JQuery UK February 2015: Service Workers On Vacay
 
PWA 應用 - 實現網站離線瀏覽
PWA 應用 - 實現網站離線瀏覽PWA 應用 - 實現網站離線瀏覽
PWA 應用 - 實現網站離線瀏覽
 
PWA Roadshow Seoul - HTTPS
PWA Roadshow Seoul - HTTPSPWA Roadshow Seoul - HTTPS
PWA Roadshow Seoul - HTTPS
 
Building Offline Ready and Installable Web App
Building Offline Ready and Installable Web AppBuilding Offline Ready and Installable Web App
Building Offline Ready and Installable Web App
 
Choosing a Javascript Framework
Choosing a Javascript FrameworkChoosing a Javascript Framework
Choosing a Javascript Framework
 
PWA Roadshow Korea - Service Worker
PWA Roadshow Korea - Service WorkerPWA Roadshow Korea - Service Worker
PWA Roadshow Korea - Service Worker
 
NLIT 2011: Chef & Capistrano
NLIT 2011: Chef & CapistranoNLIT 2011: Chef & Capistrano
NLIT 2011: Chef & Capistrano
 
"Service Worker: Let Your Web App Feel Like a Native "
"Service Worker: Let Your Web App Feel Like a Native ""Service Worker: Let Your Web App Feel Like a Native "
"Service Worker: Let Your Web App Feel Like a Native "
 
Rebooting a Cloud
Rebooting a CloudRebooting a Cloud
Rebooting a Cloud
 
Service workers and the role they play in modern day web apps
Service workers and the role they play in modern day web appsService workers and the role they play in modern day web apps
Service workers and the role they play in modern day web apps
 
Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7
Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7
Red Hat and Oracle: Delivering on the Promise of Interoperability in Java EE 7
 
Cool like a Frontend Developer: Grunt, RequireJS, Bower and other Tools
Cool like a Frontend Developer: Grunt, RequireJS, Bower and other ToolsCool like a Frontend Developer: Grunt, RequireJS, Bower and other Tools
Cool like a Frontend Developer: Grunt, RequireJS, Bower and other Tools
 
So I Wrote a Manifest
So I Wrote a ManifestSo I Wrote a Manifest
So I Wrote a Manifest
 
007. Redux middlewares
007. Redux middlewares007. Redux middlewares
007. Redux middlewares
 
Spring Booted, But... @JCConf 16', Taiwan
Spring Booted, But... @JCConf 16', TaiwanSpring Booted, But... @JCConf 16', Taiwan
Spring Booted, But... @JCConf 16', Taiwan
 
Orchestration? You Don't Need Orchestration. What You Want is Choreography.
Orchestration? You Don't Need Orchestration. What You Want is Choreography.Orchestration? You Don't Need Orchestration. What You Want is Choreography.
Orchestration? You Don't Need Orchestration. What You Want is Choreography.
 
Best Practices for creating WP REST API by Galkin Nikita
Best Practices for creating WP REST API by Galkin NikitaBest Practices for creating WP REST API by Galkin Nikita
Best Practices for creating WP REST API by Galkin Nikita
 

Viewers also liked

Service workers in JavaScript
Service workers in JavaScriptService workers in JavaScript
Service workers in JavaScriptApoorv Saxena
 
The web - What it has, what it lacks and where it must go - Istanbul
The web - What it has, what it lacks and where it must go - IstanbulThe web - What it has, what it lacks and where it must go - Istanbul
The web - What it has, what it lacks and where it must go - IstanbulRobert Nyman
 
Service Worker 101 (한국어)
Service Worker 101 (한국어)Service Worker 101 (한국어)
Service Worker 101 (한국어)Chang W. Doh
 
Disrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applicationsDisrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applicationsChris Love
 
Service Worker 201 (한국어)
Service Worker 201 (한국어)Service Worker 201 (한국어)
Service Worker 201 (한국어)Chang W. Doh
 
Service workers your applications never felt so good
Service workers   your applications never felt so goodService workers   your applications never felt so good
Service workers your applications never felt so goodChris Love
 
Service workers 기초 및 활용 (Korean)
Service workers 기초 및 활용 (Korean)Service workers 기초 및 활용 (Korean)
Service workers 기초 및 활용 (Korean)jungkees
 
프로그레시브 웹앱이란? - Progressive Web Apps
프로그레시브 웹앱이란? - Progressive Web Apps프로그레시브 웹앱이란? - Progressive Web Apps
프로그레시브 웹앱이란? - Progressive Web AppsGihyo Joshua Jang
 

Viewers also liked (8)

Service workers in JavaScript
Service workers in JavaScriptService workers in JavaScript
Service workers in JavaScript
 
The web - What it has, what it lacks and where it must go - Istanbul
The web - What it has, what it lacks and where it must go - IstanbulThe web - What it has, what it lacks and where it must go - Istanbul
The web - What it has, what it lacks and where it must go - Istanbul
 
Service Worker 101 (한국어)
Service Worker 101 (한국어)Service Worker 101 (한국어)
Service Worker 101 (한국어)
 
Disrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applicationsDisrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applications
 
Service Worker 201 (한국어)
Service Worker 201 (한국어)Service Worker 201 (한국어)
Service Worker 201 (한국어)
 
Service workers your applications never felt so good
Service workers   your applications never felt so goodService workers   your applications never felt so good
Service workers your applications never felt so good
 
Service workers 기초 및 활용 (Korean)
Service workers 기초 및 활용 (Korean)Service workers 기초 및 활용 (Korean)
Service workers 기초 및 활용 (Korean)
 
프로그레시브 웹앱이란? - Progressive Web Apps
프로그레시브 웹앱이란? - Progressive Web Apps프로그레시브 웹앱이란? - Progressive Web Apps
프로그레시브 웹앱이란? - Progressive Web Apps
 

Similar to [1C1]Service Workers

Offline First with Service Worker
Offline First with Service WorkerOffline First with Service Worker
Offline First with Service WorkerMuhammad Samu
 
Building Progressive Web Apps for Windows devices
Building Progressive Web Apps for Windows devicesBuilding Progressive Web Apps for Windows devices
Building Progressive Web Apps for Windows devicesWindows Developer
 
Maxim Salnikov - Service Worker: taking the best from the past experience for...
Maxim Salnikov - Service Worker: taking the best from the past experience for...Maxim Salnikov - Service Worker: taking the best from the past experience for...
Maxim Salnikov - Service Worker: taking the best from the past experience for...Codemotion
 
ServiceWorker: New game changer is coming!
ServiceWorker: New game changer is coming!ServiceWorker: New game changer is coming!
ServiceWorker: New game changer is coming!Chang W. Doh
 
Velocity EU 2014 — Offline-first web apps
Velocity EU 2014 — Offline-first web appsVelocity EU 2014 — Offline-first web apps
Velocity EU 2014 — Offline-first web appsandrewsmatt
 
Writing robust Node.js applications
Writing robust Node.js applicationsWriting robust Node.js applications
Writing robust Node.js applicationsTom Croucher
 
Alexey Kupriyanenko "The State of Modern JavaScript and Web in 2020 - Real us...
Alexey Kupriyanenko "The State of Modern JavaScript and Web in 2020 - Real us...Alexey Kupriyanenko "The State of Modern JavaScript and Web in 2020 - Real us...
Alexey Kupriyanenko "The State of Modern JavaScript and Web in 2020 - Real us...Fwdays
 
Play Framework: async I/O with Java and Scala
Play Framework: async I/O with Java and ScalaPlay Framework: async I/O with Java and Scala
Play Framework: async I/O with Java and ScalaYevgeniy Brikman
 
Progressive Web Apps 101
Progressive Web Apps 101Progressive Web Apps 101
Progressive Web Apps 101Muhammad Samu
 
Primefaces Nextgen Lju
Primefaces Nextgen LjuPrimefaces Nextgen Lju
Primefaces Nextgen LjuSkills Matter
 
Primefaces Nextgen Lju
Primefaces Nextgen LjuPrimefaces Nextgen Lju
Primefaces Nextgen LjuSkills Matter
 
vJUG - The JavaFX Ecosystem
vJUG - The JavaFX EcosystemvJUG - The JavaFX Ecosystem
vJUG - The JavaFX EcosystemAndres Almiray
 
Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
 	Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W... 	Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...Robert Nyman
 
Azure Durable Functions (2019-04-27)
Azure Durable Functions (2019-04-27)Azure Durable Functions (2019-04-27)
Azure Durable Functions (2019-04-27)Paco de la Cruz
 
High Performance JavaScript (Amazon DevCon 2011)
High Performance JavaScript (Amazon DevCon 2011)High Performance JavaScript (Amazon DevCon 2011)
High Performance JavaScript (Amazon DevCon 2011)Nicholas Zakas
 
Express Presentation
Express PresentationExpress Presentation
Express Presentationaaronheckmann
 

Similar to [1C1]Service Workers (20)

Offline First with Service Worker
Offline First with Service WorkerOffline First with Service Worker
Offline First with Service Worker
 
Building Progressive Web Apps for Windows devices
Building Progressive Web Apps for Windows devicesBuilding Progressive Web Apps for Windows devices
Building Progressive Web Apps for Windows devices
 
Maxim Salnikov - Service Worker: taking the best from the past experience for...
Maxim Salnikov - Service Worker: taking the best from the past experience for...Maxim Salnikov - Service Worker: taking the best from the past experience for...
Maxim Salnikov - Service Worker: taking the best from the past experience for...
 
ServiceWorker: New game changer is coming!
ServiceWorker: New game changer is coming!ServiceWorker: New game changer is coming!
ServiceWorker: New game changer is coming!
 
Velocity EU 2014 — Offline-first web apps
Velocity EU 2014 — Offline-first web appsVelocity EU 2014 — Offline-first web apps
Velocity EU 2014 — Offline-first web apps
 
Writing robust Node.js applications
Writing robust Node.js applicationsWriting robust Node.js applications
Writing robust Node.js applications
 
Serverless Java on Kubernetes
Serverless Java on KubernetesServerless Java on Kubernetes
Serverless Java on Kubernetes
 
Service workers
Service workersService workers
Service workers
 
5.node js
5.node js5.node js
5.node js
 
About Node.js
About Node.jsAbout Node.js
About Node.js
 
Alexey Kupriyanenko "The State of Modern JavaScript and Web in 2020 - Real us...
Alexey Kupriyanenko "The State of Modern JavaScript and Web in 2020 - Real us...Alexey Kupriyanenko "The State of Modern JavaScript and Web in 2020 - Real us...
Alexey Kupriyanenko "The State of Modern JavaScript and Web in 2020 - Real us...
 
Play Framework: async I/O with Java and Scala
Play Framework: async I/O with Java and ScalaPlay Framework: async I/O with Java and Scala
Play Framework: async I/O with Java and Scala
 
Progressive Web Apps 101
Progressive Web Apps 101Progressive Web Apps 101
Progressive Web Apps 101
 
Primefaces Nextgen Lju
Primefaces Nextgen LjuPrimefaces Nextgen Lju
Primefaces Nextgen Lju
 
Primefaces Nextgen Lju
Primefaces Nextgen LjuPrimefaces Nextgen Lju
Primefaces Nextgen Lju
 
vJUG - The JavaFX Ecosystem
vJUG - The JavaFX EcosystemvJUG - The JavaFX Ecosystem
vJUG - The JavaFX Ecosystem
 
Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
 	Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W... 	Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
Bringing the open web and APIs to mobile devices with Firefox OS - Whisky W...
 
Azure Durable Functions (2019-04-27)
Azure Durable Functions (2019-04-27)Azure Durable Functions (2019-04-27)
Azure Durable Functions (2019-04-27)
 
High Performance JavaScript (Amazon DevCon 2011)
High Performance JavaScript (Amazon DevCon 2011)High Performance JavaScript (Amazon DevCon 2011)
High Performance JavaScript (Amazon DevCon 2011)
 
Express Presentation
Express PresentationExpress Presentation
Express Presentation
 

More from NAVER D2

[211] 인공지능이 인공지능 챗봇을 만든다
[211] 인공지능이 인공지능 챗봇을 만든다[211] 인공지능이 인공지능 챗봇을 만든다
[211] 인공지능이 인공지능 챗봇을 만든다NAVER D2
 
[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...
[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...
[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...NAVER D2
 
[215] Druid로 쉽고 빠르게 데이터 분석하기
[215] Druid로 쉽고 빠르게 데이터 분석하기[215] Druid로 쉽고 빠르게 데이터 분석하기
[215] Druid로 쉽고 빠르게 데이터 분석하기NAVER D2
 
[245]Papago Internals: 모델분석과 응용기술 개발
[245]Papago Internals: 모델분석과 응용기술 개발[245]Papago Internals: 모델분석과 응용기술 개발
[245]Papago Internals: 모델분석과 응용기술 개발NAVER D2
 
[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈
[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈
[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈NAVER D2
 
[235]Wikipedia-scale Q&A
[235]Wikipedia-scale Q&A[235]Wikipedia-scale Q&A
[235]Wikipedia-scale Q&ANAVER D2
 
[244]로봇이 현실 세계에 대해 학습하도록 만들기
[244]로봇이 현실 세계에 대해 학습하도록 만들기[244]로봇이 현실 세계에 대해 학습하도록 만들기
[244]로봇이 현실 세계에 대해 학습하도록 만들기NAVER D2
 
[243] Deep Learning to help student’s Deep Learning
[243] Deep Learning to help student’s Deep Learning[243] Deep Learning to help student’s Deep Learning
[243] Deep Learning to help student’s Deep LearningNAVER D2
 
[234]Fast & Accurate Data Annotation Pipeline for AI applications
[234]Fast & Accurate Data Annotation Pipeline for AI applications[234]Fast & Accurate Data Annotation Pipeline for AI applications
[234]Fast & Accurate Data Annotation Pipeline for AI applicationsNAVER D2
 
Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing
Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load BalancingOld version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing
Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load BalancingNAVER D2
 
[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지
[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지
[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지NAVER D2
 
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기NAVER D2
 
[224]네이버 검색과 개인화
[224]네이버 검색과 개인화[224]네이버 검색과 개인화
[224]네이버 검색과 개인화NAVER D2
 
[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)
[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)
[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)NAVER D2
 
[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기
[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기
[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기NAVER D2
 
[213] Fashion Visual Search
[213] Fashion Visual Search[213] Fashion Visual Search
[213] Fashion Visual SearchNAVER D2
 
[232] TensorRT를 활용한 딥러닝 Inference 최적화
[232] TensorRT를 활용한 딥러닝 Inference 최적화[232] TensorRT를 활용한 딥러닝 Inference 최적화
[232] TensorRT를 활용한 딥러닝 Inference 최적화NAVER D2
 
[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지
[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지
[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지NAVER D2
 
[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터
[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터
[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터NAVER D2
 
[223]기계독해 QA: 검색인가, NLP인가?
[223]기계독해 QA: 검색인가, NLP인가?[223]기계독해 QA: 검색인가, NLP인가?
[223]기계독해 QA: 검색인가, NLP인가?NAVER D2
 

More from NAVER D2 (20)

[211] 인공지능이 인공지능 챗봇을 만든다
[211] 인공지능이 인공지능 챗봇을 만든다[211] 인공지능이 인공지능 챗봇을 만든다
[211] 인공지능이 인공지능 챗봇을 만든다
 
[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...
[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...
[233] 대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing: Maglev Hashing Scheduler i...
 
[215] Druid로 쉽고 빠르게 데이터 분석하기
[215] Druid로 쉽고 빠르게 데이터 분석하기[215] Druid로 쉽고 빠르게 데이터 분석하기
[215] Druid로 쉽고 빠르게 데이터 분석하기
 
[245]Papago Internals: 모델분석과 응용기술 개발
[245]Papago Internals: 모델분석과 응용기술 개발[245]Papago Internals: 모델분석과 응용기술 개발
[245]Papago Internals: 모델분석과 응용기술 개발
 
[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈
[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈
[236] 스트림 저장소 최적화 이야기: 아파치 드루이드로부터 얻은 교훈
 
[235]Wikipedia-scale Q&A
[235]Wikipedia-scale Q&A[235]Wikipedia-scale Q&A
[235]Wikipedia-scale Q&A
 
[244]로봇이 현실 세계에 대해 학습하도록 만들기
[244]로봇이 현실 세계에 대해 학습하도록 만들기[244]로봇이 현실 세계에 대해 학습하도록 만들기
[244]로봇이 현실 세계에 대해 학습하도록 만들기
 
[243] Deep Learning to help student’s Deep Learning
[243] Deep Learning to help student’s Deep Learning[243] Deep Learning to help student’s Deep Learning
[243] Deep Learning to help student’s Deep Learning
 
[234]Fast & Accurate Data Annotation Pipeline for AI applications
[234]Fast & Accurate Data Annotation Pipeline for AI applications[234]Fast & Accurate Data Annotation Pipeline for AI applications
[234]Fast & Accurate Data Annotation Pipeline for AI applications
 
Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing
Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load BalancingOld version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing
Old version: [233]대형 컨테이너 클러스터에서의 고가용성 Network Load Balancing
 
[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지
[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지
[226]NAVER 광고 deep click prediction: 모델링부터 서빙까지
 
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기
[225]NSML: 머신러닝 플랫폼 서비스하기 & 모델 튜닝 자동화하기
 
[224]네이버 검색과 개인화
[224]네이버 검색과 개인화[224]네이버 검색과 개인화
[224]네이버 검색과 개인화
 
[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)
[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)
[216]Search Reliability Engineering (부제: 지진에도 흔들리지 않는 네이버 검색시스템)
 
[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기
[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기
[214] Ai Serving Platform: 하루 수 억 건의 인퍼런스를 처리하기 위한 고군분투기
 
[213] Fashion Visual Search
[213] Fashion Visual Search[213] Fashion Visual Search
[213] Fashion Visual Search
 
[232] TensorRT를 활용한 딥러닝 Inference 최적화
[232] TensorRT를 활용한 딥러닝 Inference 최적화[232] TensorRT를 활용한 딥러닝 Inference 최적화
[232] TensorRT를 활용한 딥러닝 Inference 최적화
 
[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지
[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지
[242]컴퓨터 비전을 이용한 실내 지도 자동 업데이트 방법: 딥러닝을 통한 POI 변화 탐지
 
[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터
[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터
[212]C3, 데이터 처리에서 서빙까지 가능한 하둡 클러스터
 
[223]기계독해 QA: 검색인가, NLP인가?
[223]기계독해 QA: 검색인가, NLP인가?[223]기계독해 QA: 검색인가, NLP인가?
[223]기계독해 QA: 검색인가, NLP인가?
 

Recently uploaded

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 

Recently uploaded (20)

Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 

[1C1]Service Workers

  • 1. Service Workers Bring your own magic
  • 2. Jungkee Song Github: https://github.com/jungkees Twitter: @jungkees Google+: +JungkeeSong Facebook: https://www.facebook.com/jungkees See the animated version here!
  • 3. Service Workers solve … Offline Usage Offline-first Sorry, no magic. Create your own! Programmable cache control Write your own HTTP request proxy Background Processing Wanna do things while your browser is not running? Push messages, System alarm, BackgroundSync …
  • 4. Standard W3C first published working draft
  • 5. Standard Please check out the editors draft! https://slightlyoff.github.io/ServiceWorker/spec/service_worker/index.html https://github.com/slightlyoff/ServiceWorker
  • 6. Principles and terms Runs on same origin Registration keyed by URL scope Document is controlled by matching SW upon navigation Installed worker is considered worker in waiting Lifecycle events: install, activate Functional events: fetch and more to come
  • 7. Are you online? Page Navigation/Resource request Network fetch Response
  • 8. Are you sufficiently online? Page Navigation/Resource request Network fetch 4XX 5XX Timeout DNS failure
  • 9. Offline-first Have a Service Worker? fetch event Navigation/Resource request onfetch Page SW e.respondWith! (Promise<response>) Promise<response> Cache self.caches.match(url) IDB new Response({! status: 200,! body: { … }! })
  • 10. Offline-first Fallback to network with SW fetch event Navigation/Resource request onfetch Page SW Cache self.fetch(request) e.respondWith! (Promise<response>) Promise rejects self.caches.match(url)
  • 11. Event-driven worker Browsers are allowed to kill SW at any time Page Page fetch event Navigation/Resource request Navigation/Resource request onfetch Page SW e.respondWith! (Promise<response>) Promise<response> Cache self.caches.match(url) fetch event e.respondWith! (Promise<response>)
  • 12. Registration In the page [ Registration map ] Scope Script URL “/” /assets/v1/serviceworker.js // scope defaults to "/" ! navigator.serviceWorker.register("/assets/v1/serviceworker.js").then(! function(registration) { ! console.log("success!"); ! registration.installing.postMessage(“Howdy from your installing page."); ! // To use the serviceWorker immediately, you might call! // window.location.reload() ! }, function(why) { ! console.error("Installing the worker failed!", why); ! });
  • 13. Registration In the page [ Registration map ] Scope Script URL “/” sw.js “/foo/” /foo/sw.js navigator.serviceWorker.register("/sw.js"); /bar/sw.js navigator.serviceWorker.register("/foo/sw.js", { scope: “/foo/” }); navigator.serviceWorker.register("/bar/sw.js");
  • 14. Installation Registration triggers installation of the SW Browser fires install event to the installing SW Event handlers may extend the lifetime of SW for preparing its caches
  • 15. Installation: oninstall In the SW context // caching.js! this.addEventListener("install", function(e) {! e.waitUntil(! // Create a cache and add resources! caches.create(“shell-v1”).then(function(cache) {! cache.addAll([! "/app.html",! "/assets/v1/base.css",! "/assets/v1/app.js",! "/assets/v1/logo.png",! "/assets/v1/intro_video.webm"! ])! })! );! });
  • 16. Programmable cache control Via Cache / CacheStorage interfaces [Constructor]! interface Cache {! Promise<Response> ! match((Request or ScalarValueString) request, optional CacheQueryOptions options);! Promise<sequence<Response>> ! matchAll((Request or ScalarValueString) request, optional CacheQueryOptions options);! Promise<Response>! add((Request or ScalarValueString) request);! Promise<sequence<Response>> ! addAll(sequence<(Request or ScalarValueString)> requests);! Promise<Response>! put((Request or ScalarValueString) request, Response response);! Promise<boolean> ! delete((Request or ScalarValueString) request, optional CacheQueryOptions options);! Promise<sequence<Request>>! keys(optional (Request or ScalarValueString) request, optional CacheQueryOptions options);! }; caches.create(“myCache”).then(function(cache) { … })
  • 17. Have a controller yet? Worker in waiting Once self.oninstall ends So to speak, the installation is successfully done Not yet controlling the document in scope navigator.serviceWorker.controller When all the documents in scope unload The worker in waiting becomes active worker event.replace() works
  • 18. Handle a fetch: onfetch In the SW context this.addEventListener("fetch", function(e) {! // No "onfetch" events are dispatched to the ServiceWorker until it! // successfully installs.! ! // All operations on caches are async, including matching URLs, so we use! // Promises heavily. e.respondWith() even takes Promises to enable this:! e.respondWith(! caches.match(e.request).catch(function() {! return e.default();! }).catch(function() {! return caches.match("/fallback.html");! })! );! });
  • 19. Fetch: navigation request Document selects SW registration upon navigation Page Navigate to https://example.com/index.html [ Registration map ] Scope Script URL onfetch sw.js e.respondWith! (Promise<response>) Promise<response> Cacheself.caches.match(url) “/” /sw.js “/foo/” /foo/sw.js fetch event Scope matching Run SW
  • 20. Subresource request Document uses selected SW registration for subresources [ Registration map ] Scope Script URL onfetch sw.js e.respondWith! (Promise<response>) Promise<response> Cache self.caches.match(url) “/” /sw.js “/foo/” /foo/sw.js Page Fetch “https://example.com/img/flower.png fetch event Control Run SW
  • 21. Updating triggered by Registration Browser automatically Successful navigation matching API in worker context: self.update()
  • 22. Updating Document uses selected SW registration for subresources [ Registration map ] Scope active onfetch sw-v2 e.respondWith! (Promise<response>) Promise<response> Cache self.caches.match(url) “/” v1 fetch event - waiting sw-v1 [[Update]] [[Install]] Page sw-v1 /sw-v2 /-sw-v2 Page v2 Fetch “https://example.com/img/flower.png Run SW
  • 23. Security Origin relativity Cross origin resource HTTPS-only Protect end users from man-in-the-middle attacks Existing playground services (e.g. github.io) now work with HTTPS HTTPS is coming across much more of the web quickly Devtools can loosen the restriction for development
  • 24. Performance Event-driven workers Free to shutdown the worker when handler’s done Write your workers as though they will die after every request Keep the onactivate short Platform considerations Enhance matching navigation Events implicitly filter Enhance startup
  • 25. Is it ready for you? Chrome 35+ Partial under flag chrome://flags/enable-service-worker Firefox nightly Under consideration IE Partial under flag about:config > dom.serviceWorkers.enabled Stay alerted! Jake’s “Is ServiceWorker ready?”
  • 26. References and practices Service Worker - first draft published - Jake Archibald Specification Github’s explainer Github’s implementation considerations