Download free for 30 days
Sign in
Upload
Language (EN)
Support
Business
Mobile
Social Media
Marketing
Technology
Art & Photos
Career
Design
Education
Presentations & Public Speaking
Government & Nonprofit
Healthcare
Internet
Law
Leadership & Management
Automotive
Engineering
Software
Recruiting & HR
Retail
Sales
Services
Science
Small Business & Entrepreneurship
Food
Environment
Economy & Finance
Data & Analytics
Investor Relations
Sports
Spiritual
News & Politics
Travel
Self Improvement
Real Estate
Entertainment & Humor
Health & Medicine
Devices & Hardware
Lifestyle
Change Language
Language
English
Español
Português
Français
Deutsche
Cancel
Save
Submit search
EN
Uploaded by
Shogo Sensui
1,390 views
Introduction to Service Worker
2015/2/21に開催されたFrontrend Conferenceの「Introduction to Service Worker」のセッションの資料です。
Technology
◦
Read more
1
Save
Share
Embed
Embed presentation
Download
Download to read offline
1
/ 85
2
/ 85
3
/ 85
4
/ 85
5
/ 85
6
/ 85
7
/ 85
8
/ 85
9
/ 85
10
/ 85
11
/ 85
12
/ 85
13
/ 85
14
/ 85
15
/ 85
16
/ 85
17
/ 85
18
/ 85
19
/ 85
20
/ 85
21
/ 85
22
/ 85
23
/ 85
24
/ 85
25
/ 85
26
/ 85
27
/ 85
28
/ 85
29
/ 85
30
/ 85
31
/ 85
32
/ 85
33
/ 85
34
/ 85
35
/ 85
36
/ 85
37
/ 85
38
/ 85
39
/ 85
40
/ 85
41
/ 85
42
/ 85
43
/ 85
44
/ 85
45
/ 85
46
/ 85
47
/ 85
48
/ 85
49
/ 85
50
/ 85
51
/ 85
52
/ 85
53
/ 85
54
/ 85
55
/ 85
56
/ 85
57
/ 85
58
/ 85
59
/ 85
60
/ 85
61
/ 85
62
/ 85
63
/ 85
64
/ 85
65
/ 85
66
/ 85
67
/ 85
68
/ 85
69
/ 85
70
/ 85
71
/ 85
72
/ 85
73
/ 85
74
/ 85
75
/ 85
76
/ 85
77
/ 85
78
/ 85
79
/ 85
80
/ 85
81
/ 85
82
/ 85
83
/ 85
84
/ 85
85
/ 85
More Related Content
PDF
Working With Ajax Frameworks
by
Jonathan Snook
PPT
Local storages
by
Дмитрий Скинтиян
PDF
Javascript and jQuery for Mobile
by
Ivano Malavolta
KEY
jQuery for designers
by
Johan Ronsse
DOCX
Simular un next del recordset en php de forma rudimentaria
by
jbersosa
DOC
Sumahexavector
by
jbersosa
PDF
PHPのすべらない話#3
by
Moriyoshi Koizumi
DOC
Sumahex
by
jbersosa
Working With Ajax Frameworks
by
Jonathan Snook
Local storages
by
Дмитрий Скинтиян
Javascript and jQuery for Mobile
by
Ivano Malavolta
jQuery for designers
by
Johan Ronsse
Simular un next del recordset en php de forma rudimentaria
by
jbersosa
Sumahexavector
by
jbersosa
PHPのすべらない話#3
by
Moriyoshi Koizumi
Sumahex
by
jbersosa
What's hot
PDF
Php & mysql
by
ola98z
PDF
Jsoon
by
iqbalfatoni01
PDF
Sis quiz
by
Clesio Veloso
PDF
Clase 10 electiva profesional 3 aws rds php y mysql
by
Richard Eliseo Mendoza Gafaro
TXT
Miniray.php
by
maeeeng69
PDF
jQuery - Javascript para quem não sabe Javascript
by
Nando Vieira
TXT
Index2
by
grateful7
PDF
Add tag shortcode
by
Peter Baylies
DOCX
Php codigos interfaces fredy guzman cusihunca
by
Tigger_Fred
PPT
Wek14 mysql 2
by
Rani Sarungallo Rombe
PDF
Java script.trend(spec)
by
dynamis
DOCX
Dennis zapana perez
by
dennis_elvis
PDF
Sumahexavector
by
jbersosa
DOCX
Documentacion edderson callpa_ortiz
by
Edderson J. Ortiz
DOC
Phpex3
by
augustodebian
PDF
Modern Mobile Web Apps
by
dynamis
TXT
Formulario
by
tukisele
PDF
Symfony2でMongoDBと仲良くする方法
by
Koji Iwazaki
KEY
SmartCSS
by
Ryo Miyake
TXT
Func
by
Hvqr
Php & mysql
by
ola98z
Jsoon
by
iqbalfatoni01
Sis quiz
by
Clesio Veloso
Clase 10 electiva profesional 3 aws rds php y mysql
by
Richard Eliseo Mendoza Gafaro
Miniray.php
by
maeeeng69
jQuery - Javascript para quem não sabe Javascript
by
Nando Vieira
Index2
by
grateful7
Add tag shortcode
by
Peter Baylies
Php codigos interfaces fredy guzman cusihunca
by
Tigger_Fred
Wek14 mysql 2
by
Rani Sarungallo Rombe
Java script.trend(spec)
by
dynamis
Dennis zapana perez
by
dennis_elvis
Sumahexavector
by
jbersosa
Documentacion edderson callpa_ortiz
by
Edderson J. Ortiz
Phpex3
by
augustodebian
Modern Mobile Web Apps
by
dynamis
Formulario
by
tukisele
Symfony2でMongoDBと仲良くする方法
by
Koji Iwazaki
SmartCSS
by
Ryo Miyake
Func
by
Hvqr
Viewers also liked
PPTX
React を導入したフロントエンド開発
by
daisuke-a-matsui
PDF
なぜ人は必死でjQueryを捨てようとしているのか
by
Yoichi Toyota
PPTX
React NativeでTwitterクライアントを作ってみよう
by
dcubeio
PDF
【D3 公開用】ドメイン駆動設計とscala 〜既存プロジェクトへの適用〜
by
dcubeio
PDF
Flux react現状確認会
by
VOYAGE GROUP
PDF
Objective-CのBlocksの循環参照に関する僕なりのベストプラクティス
by
Naoyuki Kataoka
PDF
シロク流事業の立ち上げ方の成功と失敗
by
Naoyuki Kataoka
PPTX
Php入門
by
dcubeio
PPTX
GoogleTagManagerを使ってタグ運用を楽にしませんか?
by
dcubeio
PPT
覚えて帰ろうJavaデザインパターン
by
dcubeio
PPTX
Jenkinsを使った初めての継続的インテグレーション
by
dcubeio
PDF
Effective ES6
by
Teppei Sato
PDF
初心者のためのWeb標準技術
by
Shogo Sensui
PPTX
[D3]サーバーレスでサービスを作ってみた話
by
dcubeio
PDF
レンタルサーバで今すぐ始めるWEB開発
by
Naoyuki Kataoka
PDF
Web フロントエンドの変遷とこれから
by
Shogo Sensui
PDF
Web若手エンジニアの会(仮)
by
Naoyuki Kataoka
PDF
成長する組織を支えるシロクの自動化
by
Naoyuki Kataoka
PDF
Introduction to Resource Hints
by
Shogo Sensui
PDF
Web Components 2016 & Polymer v2
by
Shogo Sensui
React を導入したフロントエンド開発
by
daisuke-a-matsui
なぜ人は必死でjQueryを捨てようとしているのか
by
Yoichi Toyota
React NativeでTwitterクライアントを作ってみよう
by
dcubeio
【D3 公開用】ドメイン駆動設計とscala 〜既存プロジェクトへの適用〜
by
dcubeio
Flux react現状確認会
by
VOYAGE GROUP
Objective-CのBlocksの循環参照に関する僕なりのベストプラクティス
by
Naoyuki Kataoka
シロク流事業の立ち上げ方の成功と失敗
by
Naoyuki Kataoka
Php入門
by
dcubeio
GoogleTagManagerを使ってタグ運用を楽にしませんか?
by
dcubeio
覚えて帰ろうJavaデザインパターン
by
dcubeio
Jenkinsを使った初めての継続的インテグレーション
by
dcubeio
Effective ES6
by
Teppei Sato
初心者のためのWeb標準技術
by
Shogo Sensui
[D3]サーバーレスでサービスを作ってみた話
by
dcubeio
レンタルサーバで今すぐ始めるWEB開発
by
Naoyuki Kataoka
Web フロントエンドの変遷とこれから
by
Shogo Sensui
Web若手エンジニアの会(仮)
by
Naoyuki Kataoka
成長する組織を支えるシロクの自動化
by
Naoyuki Kataoka
Introduction to Resource Hints
by
Shogo Sensui
Web Components 2016 & Polymer v2
by
Shogo Sensui
More from Shogo Sensui
PDF
これからのJavaScriptの話
by
Shogo Sensui
PDF
Web Components changes Web Development
by
Shogo Sensui
PDF
Functional JavaScript with Lo-Dash.js
by
Shogo Sensui
PDF
Component of Web Frontend
by
Shogo Sensui
PDF
Brush up your Coding! 2013 winter
by
Shogo Sensui
PDF
Browser Computing Structure
by
Shogo Sensui
PDF
Introduction to Performance APIs
by
Shogo Sensui
PDF
Brush up your Coding!
by
Shogo Sensui
PDF
Web Standards 2018
by
Shogo Sensui
PDF
The State of Web Components
by
Shogo Sensui
PDF
We should optimize images
by
Shogo Sensui
PDF
Web Standards Interop 2022
by
Shogo Sensui
PDF
Re-think about Web Performance
by
Shogo Sensui
これからのJavaScriptの話
by
Shogo Sensui
Web Components changes Web Development
by
Shogo Sensui
Functional JavaScript with Lo-Dash.js
by
Shogo Sensui
Component of Web Frontend
by
Shogo Sensui
Brush up your Coding! 2013 winter
by
Shogo Sensui
Browser Computing Structure
by
Shogo Sensui
Introduction to Performance APIs
by
Shogo Sensui
Brush up your Coding!
by
Shogo Sensui
Web Standards 2018
by
Shogo Sensui
The State of Web Components
by
Shogo Sensui
We should optimize images
by
Shogo Sensui
Web Standards Interop 2022
by
Shogo Sensui
Re-think about Web Performance
by
Shogo Sensui
Introduction to Service Worker
2.
!
12.
"# $
13.
%&
20.
オフラインファーストとは
33.
' ( )
* + # , & && - - & &&
35.
var value =
localStorage['key']; var json = JSON.parse(value); localStorage['key'] = JSON.stringify(json);
36.
' ( )
* + # , - -- -- - - -
38.
var db; var objectStore; var
req = window.indexedDB.open('dbname', 3); req.onsuccess = function(event) { db = event.target.result; }; req.onupgradeneeded = function(event) { db = event.target.result; objectStore = db.createObjectStore('name', { keyPath: 'key' }); };
39.
' ( )
* + # , - -- -- - - -
40.
<html manifest=app.mf>
41.
CACHE MANIFEST # Resource
to cache CACHE: index.html stylesheet.css image.png script.js # Resource to bypass NETWORK: login.php /api/data # Fallback URLs FALLBACK: / /offline.html
45.
if (navigator.onLine) { $.ajax({ url:
'/api/data', method: 'get' }).done(function (data) { render(data); }); } else { var cacheData = localStorage.getItem('key'); render(JSON.parse(cacheData)); }
53.
var sw =
navigator.serviceWorker; sw.register('sw.js').then(function (res) { console.log('sw.js is installed!'); }, function (error) { console.log('sw.js is not installed...'); });
57.
self.addEventListener('fetch', function (e)
{ console.log('Request in Browser'); e.respondWith( new Response('Not Found', { status: 404 }) ); });
61.
fetch('/url/json').then(function (res) { return
res.json(); }).then(function (json) { console.log(json); });
66.
caches.open('cache-key').then(function(cache) { return cache.addAll([ 'js/app.js', 'css/app.css', 'img/image.png' ]); }); caches.match(e.request).then(function
(res) { return res; });
70.
var sw =
navigator.serviceWorker; sw.ready.then(function(reg) { reg.syncManager.register({ id: "periodicSync", minDelay: 60 * 60 * 1000, minPeriod: 12 * 60 * 60 * 1000, allowOnBattery: true idleRequired: false }).then(function() { // Success }); });
73.
var sw =
navigator.serviceWorker; sw.ready.then(function(reg) { reg.pushManager.subscribe().then( function(subscription) { // Success console.log(subscription.subscriptionId); console.log(subscription.endpoint); } }); });
77.
' ( )
* + # , - - - && & -
82.
e.respondWith( caches.open(CACHE_KEY).then(function (cache) { return
cache.match(e.request) .then(function (response) { if (response) { return response; } else { return fetch(e.request.clone()) .then(function (res) { cache.put(e.request, res.clone()); return res; }); } }); }) );
85.
. ! /
Download