Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Kill Pollingした話
Search
sutiwo
July 21, 2017
Programming
1
1.4k
Kill Pollingした話
sutiwo
July 21, 2017
Tweet
Share
More Decks by sutiwo
See All by sutiwo
攻めつづける FRESH! のWeb ver.新春
sutiwo
3
4.6k
FRESH! クライアントサイドパフォーマンス改善
sutiwo
1
2.2k
Other Decks in Programming
See All in Programming
syndicationd LT
ymgyt
0
110
TypeScript x GraphQLで2年開発してみて
yutank34
8
4.7k
25 Years of the JCP Program
ivargrimstad
0
1k
UnityプログラミングバイブルR6号宣伝&Unity Logging小話
adarapata
0
110
Material 3で Material 2ぽい見た目にする
numeroanddev
2
220
上手な探索的テストとその上達方法について
matsu802
1
430
Не учите алгоритмы
hellsquirrel
1
700
Learning PHP and Static Analysis with PHP Parser
inouehi
1
220
Honoとhtmx
yusukebe
6
1.1k
PHP で読む楽しいコアダンプ
sji
0
220
「Hono遍歴」と「HonoXでブログ作成」
yasu551
0
170
『データ可視化学入門』をPythonからRに翻訳した話(増強版)
bob3bob3
0
280
Featured
See All Featured
5 minutes of I Can Smell Your CMS
philhawksworth
199
19k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
101
6.6k
How STYLIGHT went responsive
nonsquared
92
4.7k
Writing Fast Ruby
sferik
619
59k
Stop Working from a Prison Cell
hatefulcrawdad
265
19k
Producing Creativity
orderedlist
PRO
335
39k
YesSQL, Process and Tooling at Scale
rocio
160
13k
The Invisible Side of Design
smashingmag
293
49k
Typedesign – Prime Four
hannesfritz
36
2k
Rebuilding a faster, lazier Slack
samanthasiow
72
8.1k
Design by the Numbers
sachag
274
18k
No one is an island. Learnings from fostering a developers community.
thoeni
14
2k
Transcript
Kill Pollingͨ͠ 2017 7.21 Վب࠲.tech#13 ʮϑϩϯτΤϯυΞʔΩςΫνϟษڧձʯLT @su9wo
• su9wo / su9wo_ •CyberAgent, Inc. •ϑϩϯτΤϯδχΞ •FRESH! hKps:/ /freshlive.tv
•WebPush • hKps:/ /twiKer.com/FRESH_STAFF/status/887960571487764481 •Service Workerͷಋೖ • hKps:/ /developers.cyberagent.co.jp/blog/archives/6057/ •ΞΫηγϏϦςΟΨΠυϥΠϯʹج͍࣮ͮͨ
• hKps:/ /openfresh.github.io/a11y-guidelines/ ϑϩϯτνʔϜͰ࠷ۙͬͯΔ͜ͱ
Kill Polling͢Δཧ༝ • ଈ࣌ੑ͕ͳ͍ • ͍߹ΘͤܗࣜͳͷͰɺແବͳ௨৴ൃੜ • ͔ͬ͜ѱ͍
• ൪εςʔλεͷߋ৽ (։࢝์ૹதऴྃ) • ൪εςʔλεͷߋ৽ (ແྉ༗ྉ) • ࢹௌͷߋ৽ • ίϝϯτͷߋ৽
• ։࢝ɾऴྃ࣌ؒͷߋ৽ FRESH!ͰͷϢʔεέʔε
None
None
None
None
None
SSE (Server-Sent Events) • αʔό͔ΒΫϥΠΞϯτͷ୯Ұํ௨৴ • ςΩετͷΈ(όΠφϦbase64͢Δ) • IE11polyfill hKps:/
/github.com/Yaffle/EventSource/
Plasma • hKps:/ /github.com/openfresh/plasma • ΠϕϯτϓογϡͷϛυϧΣΞ • WebϒϥβSSE / ωΠςΟϒΞϓϦgRPC
• SSEʹΑͬͯαʔό͔ΒΠϕϯτΛड͚औΔ͜ͱ͕Ͱ͖Δ • ಙͷߴ͍ঁੑ༏͖Πϯλʔϯੜ࡞
ྲྀΕ • ॳظϨϯμϦϯά࣌ʹσʔλΛStoreʹอ࣋ • Plasmaଓ new EventSource(url, opts);ʹ.addEventListener(); • ߋ৽Λݕͨ͠ΒStoreͰJSON.parse,
Object.assignͰࠩΛ্ॻ͖ • ൪ऴྃޙߋ৽ͷඞཁ͕ͳ͘ͳͬͨΒ.removeEventListener();
σόοά • DevToolsͰΈΕ·͢
݁Ռ
ϙʔϦϯάͷϦΫΤετׂ߹ 0 % 7,5 % 15 % 22,5 % 30
% ϦϦʔεલ ϦϦʔε ϦϦʔεཌ ϦϦʔεཌʑ 0,85 % 1,43 % 21,15 % 27,8 %