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
Anthropic Cookbook のおすすめレシピ
schroneko
7
1.1k
R言語の環境構築と基礎 Tokyo.R 112
bob3bob3
0
280
AWS CDKコントリビュートTIPS / aws-cdk-contribution-tips
gotok365
4
370
From Spring Boot 2 to Spring Boot 3 with Java 21 and Jakarta EE
ivargrimstad
0
470
Behind VS Code Extensions for JavaScript / TypeScript Linnting and Formatting
unvalley
6
1.2k
雑に思考を整理する技術と効能
konifar
63
30k
Build Apps for iOS, Android & Desktop in 100% Kotlin With Compose Multiplatform (mDevCamp 2024)
zsmb
0
430
禅の心を手に入れよ
eltociear
1
290
DMMプラットフォームがTiDB Cloudを採用した背景
pospome
9
4.2k
PHPはいつから死んでいるかの調査
chiroruxx
2
410
PHP8.3の機能を振り返る / Review of PHP 8.3 features
seike460
PRO
1
120
初心者のためのRubyKaigi入門/RubyKaigi Introduction
a_matsuda
8
1.4k
Featured
See All Featured
Intergalactic Javascript Robots from Outer Space
tanoku
266
26k
The Illustrated Children's Guide to Kubernetes
chrisshort
32
46k
Bash Introduction
62gerente
605
210k
Atom: Resistance is Futile
akmur
260
25k
Rails Girls Zürich Keynote
gr2m
91
13k
Stop Working from a Prison Cell
hatefulcrawdad
267
19k
Facilitating Awesome Meetings
lara
43
5.6k
Design by the Numbers
sachag
274
18k
GraphQLの誤解/rethinking-graphql
sonatard
55
9.3k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
222
21k
Thoughts on Productivity
jonyablonski
60
3.9k
The Cult of Friendly URLs
andyhume
74
5.7k
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 %