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
モバイルアプリでHTTP/2
Search
Naoki Morioka
April 04, 2016
1
130
モバイルアプリでHTTP/2
モバイルアプリでHTTP/2
Naoki Morioka
April 04, 2016
Tweet
Share
More Decks by Naoki Morioka
See All by Naoki Morioka
Androidアプリ開発からみた RxJavaの使いどころ
nmorioka
1
3.8k
10年運用している 画像サービスでのJavaの活用と 今後の展望
nmorioka
0
510
既存AndroidアプリでKotlin導入を考える
nmorioka
0
96
Cardbord SDK
nmorioka
0
87
AndroidでJava8
nmorioka
0
280
Featured
See All Featured
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
0
89
Raft: Consensus for Rubyists
vanstee
136
6.6k
Build your cross-platform service in a week with App Engine
jlugia
229
18k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
Measuring & Analyzing Core Web Vitals
bluesmoon
4
120
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
4
370
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Code Review Best Practice
trishagee
64
17k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
VelocityConf: Rendering Performance Case Studies
addyosmani
325
24k
Building an army of robots
kneath
302
43k
Transcript
ϞόΠϧΞϓϦͰHTTP/2 @n_morioka ؔϞόΠϧΞϓϦݚڀձ#12 2016/03/30
About me • Ԭ ঘه(@n_morioka) • ϑϦϡʔגࣜձࣾͰϞόΠϧΞϓϦ։ൃͯ͠· ͢ • ࠷ۙͷڵຯ
→ ͋Γ͕ͪͳʮӳޠֶशʯͱ ʮServer-side Swiftʯͱʮζϯɾυίʯ
HTTP/2 • લճͷOkhttp3ͷൃද͔Βͷଓ͖ • HTTP/2 is ready! (2015/05 RFC7540) •
SPDY is deprecated! • HTTP/1ͷηϚϯςΟΫεΛҡ࣋ͨ͠··ύϑΥʔϚ ϯεΛվળ͢Δͷ͕ൃ
දతͳػೳ
௨৴ετϦʔϜଟॏʹΑΔߴԽ
ग़ల:http://blog.redbox.ne.jp/http2-cdn.html
HTTPϔομͷѹॖ(HPACK)
RFC 7541 HPACK: Header Compression for HTTP/2 SPDYͷϔομѹॖηΩϡϦςΟϦε Ϋ͋ΓͳͷͰ৽ͨʹఏҊ͞Εͨѹॖํ๏
͔ΜͨΜʹݴ͏ͱ ϔομͷࣙॻ࡞ͬͯ ಉ͡σʔλ͕དྷͨΒѹॖ͢Δ
ͦͷଞදతͳػೳ(ࡶ) • ༏ઌ͖ΞΫηε(JavaScript࠷ޙʹಡΈࠐΉΑ ͏ࢦࣔͳͲ) • αʔόϓογϡ(htmlͱ͍ͬ͠ΐʹcss͚ͯฦ٫ ͳͲՄೳ)
iOSͱAndroid྆ํͷରԠঢ়گͳͲ Λ֬ೝ͢Δ
iOS • iOS9 Ҏ߱ͰରԠ • NSURLSessionΛར༻͢Δ͜ͱ • Mobile SafariͰରԠ
Android • Android 5 Ҏ߱ + OkHttp3Λར༻͢Δʢ͘Β͍͔͠ ݟͨΒͳ͍ʣ • ALPNͱ͍͏ωΰγΤʔγϣϯํ๏ରԠͷwebαʔό
Λ༻ҙ͢Δඞཁ͕͋Δ • Chrome for Android v46͔Βར༻Մೳ
αʔόΛཱͯΔ
දతͳHTTP/2αʔό • nginx 1.9.5Ҏ߱ (ߏங͕Ұ൪ָ) • apache 2.4.17Ҏ߱ (libnghttp2͕ඞཁ) •
h2o • nghttp2
AndroidରԠ͢ΔͳΒALPNͷͨΊʹ OpenSSL(v1.0.2Ҏ߱)͝ͱೖΕΔ ඞཁ͕ग़ͯ͘ΔՄೳੑେ
ಋೖͯ͠ϝϦοτ͋Δͷ͔
௨৴ετϦʔϜͷଟॏԽʁ
શ͘มΘΒͣ
ΞϓϦ͔ΒͷAPIίʔϧͰ PromiseΈ͍ͨͳͷͰଟॏԽ ͞ΕͯΔʁ
HTTPϔομͷѹॖʁ
؆қͳϨεϙϯεΛฦ͢APIʹͯ 1000ճݺͼग़͠Ͱ 800KByteఔσʔλྔݮ (ଆ௨৴ྔௐ)
Conclusions • HTTP/2Λར༻ग़དྷΔঢ়گ͖ͬͯͨ • ϞόΠϧΞϓϦͰ௨৴ετϦʔϜଟॏԽͷޮՌ গͳ͍ • ௨৴σʔλྔݮʹޮՌ͋Γͦ͏ • SPDYಋೖ͍ͯͨ͠Β͙͢ʹมߋ͠ͳͯ͘ྑ͍͔
Enjoy Development ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ