HTTP/2 en pratique

rocket lite

Introduction

HTTP/2 vs HTTP/1.1

HTTP/2 vs HTTP/1.1

Multiplexing

image/svg+xml

Multiplexing

Multiplexing

nghttp2

TLS or not TLS ?

  • h2
    • Basé sur TLS
    • HTTP/1.1 + ALPN
  • h2c
    • Clear Text
    • Direct ou Upgrade

TLS - ALPN

image/svg+xml TLS versions: ... Client Hello Server Hello Certificate Client Key Exchange Ciphers: ... Extension: ALPN TLS version: ... Cipher: ... Extension: ALPN=h2 support

HTTP Upgrade

image/svg+xml Connection: Upgrade,HTTP2-SettingsUpgrade: h2cHTTP2-Settings:... GET / HTTP/1.1 HTTP/1.1 "101 Switching Protocols" HTTP/2 Connection: UpgradeUpgrade: h2c[HTTP2 settings...]

Démos

Demo network

Clients

keyboard

Navigateurs

caniuse h2

Ligne de commande

Langages

JavaScript

Java

                      Serveurs

server

nghttp2

Apache HTTP Server

apache feather

  • Module mod_http2
    • Version 2.4.17+
    • Basé sur nghttp2

Apache HTTP Server

apache feather

  • Protocole h2c
    • Direct ou Upgrade

Apache HTTP Server

apache feather

  • Protocole h2
    • ALPN (OpenSSL 1.0.2+)

foutoir

Express

Express

tuyaux

Apache Tomcat

Apache Tomcat

Apache Tomcat

The required versions of the HTTP specification that a container must implement are HTTP/1.1 and HTTP/2.

When supporting HTTP/2, servlet containers must support the “h2” and “h2c” protocol identifiers (as specified in section 3.1 of the HTTP/2 RFC). This implies all servlet containers must support ALPN.

JSR 369 - Servlet 4.0

Push

scrum

Push

Preload

  • Via HTML
  • Via HTTP Headers

Preload

The server MAY initiate server push for preload link resources defined by the application for which it is authoritative.

W3C preload specification (draft)

Preload

Apache HTTP server

Apache HTTP server

nginx

NodeJS

Vert.x

JavaEE

Bonne idée ?

Rest Stream

A revoir !!

Reverse proxy

proxy

Reverse proxy

image/svg+xml http/2 http/1.1 http/2

Reverse proxy

image/svg+xml http/2 http/1.1 http/2

Reverse proxy

image/svg+xml http/2 http/1.1 http/2

nghttp2

Apache HTTP server

Nginx

There is almost no sense to implement it,…​

Maxim Dounin (nginx) - déc. 2015

Nginx

nginx roadmap

Conclusion

cochons

HTTP/2 vs HTTP/1.1

Impact

Impact

Enabling HTTP/2 on your Apache Server has impact on the resource consumption and if you have a busy site, you may need to consider carefully the implications.

Apache documentation

Impact

Références