モバイルアプリでHTTP/2

002c7b95e7b8f34186ffd6abaa136a99?s=47 Naoki Morioka
April 04, 2016
72

 モバイルアプリでHTTP/2

モバイルアプリでHTTP/2

002c7b95e7b8f34186ffd6abaa136a99?s=128

Naoki Morioka

April 04, 2016
Tweet

Transcript

  1. ϞόΠϧΞϓϦͰHTTP/2 @n_morioka ؔ੢ϞόΠϧΞϓϦݚڀձ#12 2016/03/30

  2. About me • ੝Ԭ ঘه(@n_morioka) • ϑϦϡʔגࣜձࣾͰϞόΠϧΞϓϦ։ൃͯ͠· ͢ • ࠷ۙͷڵຯ

    → ͋Γ͕ͪͳʮӳޠֶशʯͱ ʮServer-side Swiftʯͱʮζϯɾυίʯ
  3. HTTP/2 • લճͷOkhttp3ͷൃද͔Βͷଓ͖ • HTTP/2 is ready! (2015/05 RFC7540) •

    SPDY is deprecated! • HTTP/1ͷηϚϯςΟΫεΛҡ࣋ͨ͠··ύϑΥʔϚ ϯεΛվળ͢Δͷ͕ൃ୺
  4. ୅දతͳػೳ

  5. ௨৴ετϦʔϜଟॏʹΑΔߴ଎Խ

  6. ग़ల:http://blog.redbox.ne.jp/http2-cdn.html

  7. HTTPϔομͷѹॖ(HPACK)

  8. RFC 7541 HPACK: Header Compression for HTTP/2 SPDYͷϔομѹॖ͸ηΩϡϦςΟϦε Ϋ͋ΓͳͷͰ৽ͨʹఏҊ͞Εͨѹॖํ๏

  9. ͔ΜͨΜʹݴ͏ͱ ϔομͷࣙॻ࡞ͬͯ ಉ͡σʔλ͕དྷͨΒ௒ѹॖ͢Δ

  10. ͦͷଞ୅දతͳػೳ(ࡶ) • ༏ઌ౓෇͖ΞΫηε(JavaScript͸࠷ޙʹಡΈࠐΉΑ ͏ࢦࣔͳͲ) • αʔόϓογϡ(htmlͱ͍ͬ͠ΐʹcss΋෇͚ͯฦ٫ ͳͲՄೳ)

  11. iOSͱAndroid྆ํͷରԠঢ়گͳͲ Λ֬ೝ͢Δ

  12. iOS • iOS9 Ҏ߱ͰରԠ • NSURLSessionΛར༻͢Δ͜ͱ • Mobile SafariͰ΋ରԠ

  13. Android • Android 5 Ҏ߱ + OkHttp3Λར༻͢Δʢ͘Β͍͔͠ ݟ౰ͨΒͳ͍ʣ • ALPNͱ͍͏ωΰγΤʔγϣϯํ๏ରԠͷwebαʔό

    Λ༻ҙ͢Δඞཁ͕͋Δ • Chrome for Android v46͔Βར༻Մೳ
  14. αʔόΛཱͯΔ

  15. ୅දతͳHTTP/2αʔό • nginx 1.9.5Ҏ߱ (ߏங͕Ұ൪ָ) • apache 2.4.17Ҏ߱ (libnghttp2͕ඞཁ) •

    h2o • nghttp2
  16. Android΋ରԠ͢ΔͳΒALPNͷͨΊʹ OpenSSL(v1.0.2Ҏ߱)͝ͱೖΕΔ ඞཁ͕ग़ͯ͘ΔՄೳੑେ

  17. ಋೖͯ͠ϝϦοτ͸͋Δͷ͔

  18. ௨৴ετϦʔϜͷଟॏԽ͸ʁ

  19. ଎౓͸શ͘มΘΒͣ

  20. ΞϓϦ͔ΒͷAPIίʔϧͰ͸ PromiseΈ͍ͨͳͷͰଟॏԽ ͞ΕͯΔʁ

  21. HTTPϔομͷѹॖ͸ʁ

  22. ؆қͳϨεϙϯεΛฦ͢APIʹͯ 1000ճݺͼग़͠Ͱ 800KByteఔ౓σʔλྔ࡟ݮ (୺຤ଆ௨৴ྔௐ΂)

  23. Conclusions • HTTP/2Λར༻ग़དྷΔঢ়گ͸੔͖ͬͯͨ • ϞόΠϧΞϓϦͰ͸௨৴ετϦʔϜଟॏԽͷޮՌ͸ গͳ͍ • ௨৴σʔλྔ࡟ݮʹ͸ޮՌ͋Γͦ͏ • SPDYಋೖ͍ͯͨ͠Β͙͢ʹมߋ͠ͳͯ͘ྑ͍͔΋

  24. Enjoy Development ͋Γ͕ͱ͏͍͟͝·ͨ͠ʂ