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
520
既存AndroidアプリでKotlin導入を考える
nmorioka
0
98
Cardbord SDK
nmorioka
0
88
AndroidでJava8
nmorioka
0
280
Featured
See All Featured
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.9k
The World Runs on Bad Software
bkeepers
PRO
65
11k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
28
2.1k
Practical Orchestrator
shlominoach
186
10k
KATA
mclloyd
29
14k
Writing Fast Ruby
sferik
628
61k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.2k
Typedesign – Prime Four
hannesfritz
40
2.4k
Optimising Largest Contentful Paint
csswizardry
33
3k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
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 ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ