HTTP/2
-
Upload
gabriell-nascimento -
Category
Internet
-
view
39 -
download
0
Transcript of HTTP/2
![Page 1: HTTP/2](https://reader035.fdocumentos.tips/reader035/viewer/2022062712/55d2cba9bb61eb697e8b475d/html5/thumbnails/1.jpg)
HTTP/2
Gabriell Nascimento
![Page 2: HTTP/2](https://reader035.fdocumentos.tips/reader035/viewer/2022062712/55d2cba9bb61eb697e8b475d/html5/thumbnails/2.jpg)
HTTP/2
● Nova versão do HTTP● Protocolo de comunicação● Baseado no SPDY
![Page 3: HTTP/2](https://reader035.fdocumentos.tips/reader035/viewer/2022062712/55d2cba9bb61eb697e8b475d/html5/thumbnails/3.jpg)
SPDY: Objetivos
● 50% menos tempo de carregamento● Evitar mudanças em websites e infra● Open source● Métricas reais de performance
![Page 4: HTTP/2](https://reader035.fdocumentos.tips/reader035/viewer/2022062712/55d2cba9bb61eb697e8b475d/html5/thumbnails/4.jpg)
A Web mudou muito desde 1997
![Page 5: HTTP/2](https://reader035.fdocumentos.tips/reader035/viewer/2022062712/55d2cba9bb61eb697e8b475d/html5/thumbnails/5.jpg)
Várias funcionalidades legais no HTTP/2!
![Page 6: HTTP/2](https://reader035.fdocumentos.tips/reader035/viewer/2022062712/55d2cba9bb61eb697e8b475d/html5/thumbnails/6.jpg)
Várias funcionalidades legais no HTTP/2!Mas não vai matar tudo que já existe!
![Page 7: HTTP/2](https://reader035.fdocumentos.tips/reader035/viewer/2022062712/55d2cba9bb61eb697e8b475d/html5/thumbnails/7.jpg)
● Multiplexação de mensagens● Conexão TCP única
Funcionalidades
![Page 8: HTTP/2](https://reader035.fdocumentos.tips/reader035/viewer/2022062712/55d2cba9bb61eb697e8b475d/html5/thumbnails/8.jpg)
HTTP/1.1
Hi there!
I’m HTTP/1.1 only :)
http://http2.example.com
Cliente Servidor
![Page 9: HTTP/2](https://reader035.fdocumentos.tips/reader035/viewer/2022062712/55d2cba9bb61eb697e8b475d/html5/thumbnails/9.jpg)
Conexão
Stream
HTTP/2
Mensagem (Requisição)
Mensagem (Resposta)
…
QuadroQuadro
QuadroQuadro Quadro
![Page 10: HTTP/2](https://reader035.fdocumentos.tips/reader035/viewer/2022062712/55d2cba9bb61eb697e8b475d/html5/thumbnails/10.jpg)
HTTP/2
stream 5DATA
Hi there!
I’m HTTP/2 :D
http://http2.example.com
… stream 1
DATAstream 3
HEADERSstream 3
DATAstream 1
DATA
Conexão HTTP/2Cliente Servidor
![Page 11: HTTP/2](https://reader035.fdocumentos.tips/reader035/viewer/2022062712/55d2cba9bb61eb697e8b475d/html5/thumbnails/11.jpg)
● Controle de fluxo● Priorização de stream
Funcionalidades
![Page 12: HTTP/2](https://reader035.fdocumentos.tips/reader035/viewer/2022062712/55d2cba9bb61eb697e8b475d/html5/thumbnails/12.jpg)
HTTP/2
*
D1
E8
C8
B12
A4
raíz implícita
streampeso
![Page 13: HTTP/2](https://reader035.fdocumentos.tips/reader035/viewer/2022062712/55d2cba9bb61eb697e8b475d/html5/thumbnails/13.jpg)
● Server push
Funcionalidades
![Page 14: HTTP/2](https://reader035.fdocumentos.tips/reader035/viewer/2022062712/55d2cba9bb61eb697e8b475d/html5/thumbnails/14.jpg)
HTTP/2
stream 1DATA
Hi there!
I’m HTTP/2 :D
http://http2.example.com stream 2PUSH_
PROMISE
stream 4PUSH_
PROMISE
stream 1HEADERS
stream 4DATA
Conexão HTTP/2Cliente Servidor
…
stream 1: /index.html (requisição)stream 2: /style.css (push)stream 4: /script.js (push)
![Page 15: HTTP/2](https://reader035.fdocumentos.tips/reader035/viewer/2022062712/55d2cba9bb61eb697e8b475d/html5/thumbnails/15.jpg)
● Compressão de cabeçalho (HPACK)
Funcionalidades
![Page 16: HTTP/2](https://reader035.fdocumentos.tips/reader035/viewer/2022062712/55d2cba9bb61eb697e8b475d/html5/thumbnails/16.jpg)
HTTP/2
:method GET
:scheme https
:host example.com
:path /index.html
user-agent Mozilla/5.0…
foo bar
1 :authority
2 :method GET
… … …
51 referer
… … …
64 user-agent Mozilla/5.0…
65 host example.com
2
7
65
19 Huffman(“/index.html”)
64
Huffman(“foo”)
Huffman(“bar”)
cabeçalhos de requisiçãotabela estática
tabela dinâmica
cabeçalhos codificados
![Page 17: HTTP/2](https://reader035.fdocumentos.tips/reader035/viewer/2022062712/55d2cba9bb61eb697e8b475d/html5/thumbnails/17.jpg)
● Camada binária
Funcionalidades
![Page 18: HTTP/2](https://reader035.fdocumentos.tips/reader035/viewer/2022062712/55d2cba9bb61eb697e8b475d/html5/thumbnails/18.jpg)
HTTP/2
Bit 0..7 8..15 16..23 24..31
0 Tamanho do quadro Tipo do quadro
32 Flags
40 Reservado Identificador do stream
… Payload do quadro
![Page 19: HTTP/2](https://reader035.fdocumentos.tips/reader035/viewer/2022062712/55d2cba9bb61eb697e8b475d/html5/thumbnails/19.jpg)
E já dá pra usar?
![Page 20: HTTP/2](https://reader035.fdocumentos.tips/reader035/viewer/2022062712/55d2cba9bb61eb697e8b475d/html5/thumbnails/20.jpg)
Suporte
● Principais navegadores ✓● Servidores web:
o Apache ✓o Tomcat ✓o Nginx ✗
● Websites ±
![Page 21: HTTP/2](https://reader035.fdocumentos.tips/reader035/viewer/2022062712/55d2cba9bb61eb697e8b475d/html5/thumbnails/21.jpg)
Mais informações
http://chimera.labs.oreilly.com/books/1230000000545/ch12.html
![Page 22: HTTP/2](https://reader035.fdocumentos.tips/reader035/viewer/2022062712/55d2cba9bb61eb697e8b475d/html5/thumbnails/22.jpg)
Obrigado!