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.6k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Kill Pollingした話
sutiwo
July 21, 2017
More Decks by sutiwo
See All by sutiwo
攻めつづける FRESH! のWeb ver.新春
sutiwo
3
5.4k
FRESH! クライアントサイドパフォーマンス改善
sutiwo
1
2.5k
Other Decks in Programming
See All in Programming
Signal Forms: Details & Live Coding @enterJS 2026 in Mannheim
manfredsteyer
PRO
0
120
Oxlintのカスタムルールの現況
syumai
6
1.1k
ふつうのFeature Flag実践入門
irof
7
3.8k
フロントエンドとバックエンドで「1文字」を揃えよう
youkidearitai
PRO
0
510
技術記事、 専門家としてのプログラマ、 言語化
mizchi
13
5.4k
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
270
キャリア迷子上等 ─ "ない道"は自分で作ればいい
16bitidol
3
2k
気圧・高度・GPSを記録&可視化するアプリ「Koudo」を作った話
hjmkth
1
200
Observability in Practice:Grafana 與 Edge Device SRE 的那些事
blueswen
0
160
依存関係から依存物へ―Dependencyという言葉の歴史をひも解く
j_lee
0
120
Make SRE Operations Easier with Azure SRE Agent
kkamegawa
0
5.7k
JJUG CCC 2026 Spring: JSpecify で実現する Kotlin フレンドリーな Java API 設計
ternbusty
1
160
Featured
See All Featured
AI: The stuff that nobody shows you
jnunemaker
PRO
8
710
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.9k
How To Speak Unicorn (iThemes Webinar)
marktimemedia
1
480
The Art of Programming - Codeland 2020
erikaheidi
57
14k
WCS-LA-2024
lcolladotor
0
630
For a Future-Friendly Web
brad_frost
183
10k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.4k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
280
Typedesign – Prime Four
hannesfritz
42
3.1k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
5.9k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
160
SEO for Brand Visibility & Recognition
aleyda
0
4.6k
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 %