Upgrade to Pro — share decks privately, control downloads, hide ads and more …

HTTP2

 HTTP2

Marcus Barcelos

May 11, 2016
Tweet

More Decks by Marcus Barcelos

Other Decks in Technology

Transcript

  1. pen4education Vamos falar sobre o futuro da Web: HTTP/2 Gabriell

    Nascimento Marcus Barcelos Trilha Web @gabriellhrn @mvlbarcelos
  2. pen4education ➔ GET ➔ HEAD ➔ POST ➔ PUT ➔

    DELETE HTTP/1.1 Métodos ➔ TRACE ➔ OPTIONS ➔ CONNECT ➔ PATCH
  3. pen4education ✓ Concatenação ✓ Sprites ✓ Domain sharding ✓ Cabeçalhos/Cookies

    HTTP/1.1 Boas práticas ✓ CSS no topo ✓ JS no final ✓ Minificação ✓ Compressão (gzip)
  4. pen4education ➔ Concatenar (CSS/JS) ➔ Sprites ➔ Domain sharding ◆

    cdn1.bluesoft.com.br ◆ cdn2.bluesoft.com.br HTTP/1.1 Diminuir requisições
  5. pen4education HTTP/1.1 Head of line blocking Hi there! I’m HTTP/1.1

    only :) https://h1.example.com Cliente Servidor
  6. pen4education HTTP/2 Multiplexação de mensagens Hi there! I’m HTTP/2 :D

    https://h2.example.com Cliente stream 7 DATA … stream 3 DATA stream 5 HEADERS stream 5 DATA stream 3 DATA Conexão HTTP/2 Servidor
  7. $ nghttp -nv https://h2.example.com ... [ 0.009] recv HEADERS frame

    <length=30, flags=0x04, stream_id=39> ; END_HEADERS (padlen=0) ; First response header [ 0.009] recv (stream_id=41) :status: 200 [ 0.009] recv (stream_id=41) content-length: 4864 [ 0.009] recv (stream_id=41) content-type: image/png [ 0.009] recv HEADERS frame <length=30, flags=0x04, stream_id=41> ; END_HEADERS (padlen=0) ; First response header [ 0.010] recv DATA frame <length=7456, flags=0x01, stream_id=39> ; END_STREAM [ 0.010] recv DATA frame <length=4864, flags=0x01, stream_id=41> ; END_STREAM [ 0.010] recv DATA frame <length=16384, flags=0x00, stream_id=43> [ 0.010] recv DATA frame <length=4883, flags=0x00, stream_id=45> ...
  8. pen4education HTTP/2 Priorização de requisições * A 1 B 8

    C 8 D 12 E 4 A - main.css B - script.js C - style.css D - substyle.css E - favicon.ico
  9. pen4education HTTP/2 Compressão de cabeçalho Hi there! I’m HTTP/2 :D

    https://h2.example.com Cliente Servidor stream 3 HEADERS 1 :method: GET 2 :path: /login 3 :scheme: https 1 :method: GET 2 :path: /home 3 :scheme: https
  10. pen4education ✓ Concatenação ✓ Sprites ✓ Domain sharding ✓ Cabeçalhos/Cookies

    HTTP/1.1 Boas práticas ✓ CSS no topo ✓ JS no final ✓ Minificação ✓ Compressão (gzip)
  11. pen4education ✗ Concatenação ✗ Sprites ✗ Domain sharding ✗ Cabeçalhos/Cookies

    HTTP/2 Boas práticas ✗ CSS no topo ✗ JS no final ✓ Minificação ✓ Compressão (gzip)
  12. pen4education ✓ Google Chrome ✓ Internet Explorer ✓ Microsoft Edge

    ✓ Mozilla Firefox ✓ Safari HTTP/2 Navegadores https://github.com/http2/http2-spec/wiki/Implementations https://en.wikipedia.org/wiki/Comparison_of_web_browsers#Protocol_support * Versões mais recentes
  13. pen4education ✓ Apache HTTP Server 2.4.17+ ✓ Apache Tomcat 8.5+

    ✓ Microsoft IIS WinServer 2016 ✓ Nginx 1.9.5+ HTTP/2 Servidores web https://github.com/http2/http2-spec/wiki/Implementations https://en.wikipedia.org/wiki/HTTP/2#Software_and_services_supporting_HTTP.2F2