Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.

HTTP/2 and Java: Current Status

22.815 Aufrufe

Veröffentlicht am

HTTP 2.0 is supposed to be the next big thing for the web, after the overwhelming success of HTTP 1.1.
A dive into the HTTP 2.0 protocol, what is the status of its specification, what features does it offer over HTTP 1.1, and how websites can benefit (in speed and money) from it.
An exploration of what does it take to write HTTP 2.0 applications in the Java platform, what plans there are to support it in JDK 9 and which Servlet Containers are already offering HTTP 2.0 support.

Veröffentlicht in: Software

HTTP/2 and Java: Current Status

  1. 1. Simone Bordet sbordet@webtide.com HTTP/2 & Java Current Status
  2. 2. Simone Bordet sbordet@webtide.com Who Am I Simone Bordet  sbordet@intalio.com - @simonebordet Lead Architect at Intalio/Webtide  Jetty's HTTP/2, SPDY and HTTP client maintainer Open Source Contributor  Jetty, CometD, MX4J, Foxtrot, LiveTribe, JBoss, Larex CometD project leader  Web messaging framework JVM tuning expert
  3. 3. Simone Bordet sbordet@webtide.com HTTP/2: Why
  4. 4. Simone Bordet sbordet@webtide.com HTTP/2: Why http://w3c.org ~ 1996  1 HTML file, 600 bytes
  5. 5. Simone Bordet sbordet@webtide.com HTTP/2: Why http://w3c.org ~ 2015  41 resources, 366 KiB ~ 1 HTML, 4 CSS, 2 JS, 34 images
  6. 6. Simone Bordet sbordet@webtide.com HTTP/2: Why http://cnn.com ~ 2015  95 resources, 6.7 MiB ~ 3 HTML, 4 CSS, 30 JS, 58 imgs
  7. 7. Simone Bordet sbordet@webtide.com HTTP/2: Why The Web EXPLODED ! HTTP 1.1 is an old protocol  Extremely inefficient  No multiplexing, no resource correlation Web developers hacking around limitations  Domain sharding, resource inlining, image spriting, etc. Browser vendors want to make browsers FAST  Break HTTP 1.1 recommendations
  8. 8. Simone Bordet sbordet@webtide.com HTTP/2: Why Servers want to BE REALLY FAST
  9. 9. Simone Bordet sbordet@webtide.com HTTP/2: Why Better HTTP means MORE MONEY
  10. 10. Simone Bordet sbordet@webtide.com HTTP/2: How
  11. 11. Simone Bordet sbordet@webtide.com HTTP/2: How HTTP/2: Binary protocol  Based on the SPDY protocol (Google's experiment)  Efficient to parse and generate  Based on frames HEADERS HEADERS DATA DATA DATA
  12. 12. Simone Bordet sbordet@webtide.com HTTP/2: How HTTP/2: TLS everywhere  Usage of TLS (SSL) is a MUST for browsers  Very strict subset of strong ciphers Transparent proxy problem  Caching proxies don't work anymore  Big problem for certain countries Server-to-Server communication may be in clear  Not every server supports clear-text HTTP/2
  13. 13. Simone Bordet sbordet@webtide.com HTTP/2: How HTTP/2: Multiplexed  No more domain sharding and spriting hacks needed HEADERS HEADERS HEADERS HEADERS HEADERS HEADERS DATA DATA
  14. 14. Simone Bordet sbordet@webtide.com HTTP/2: How HTTP/2: HTTP Headers compression  Optimized usage of network  Using Huffman coding  ~600B → ~90B => 85% saved on headers HTTP/2: Request Prioritazion  Resources may have a priority  Clients may even re-prioritize HTTP/2: Push of correlated HTTP resources  Less roundtrips to get all resources  Huge benefits in page rendering
  15. 15. Simone Bordet sbordet@webtide.com HTTP/2: How index.html style.css application.js image1.png Push Cache index.html application.js style.css image1.png HTTP/1.1 HTTP/2 + PUSH
  16. 16. Simone Bordet sbordet@webtide.com HTTP/2: When
  17. 17. Simone Bordet sbordet@webtide.com HTTP/2: When HTTP/2 Specification is RFC 7540 Browsers already implement HTTP/2 (TLS only)  Firefox 34  Chrome 38  Internet Explorer 11 It's already there  Twitter, Google, major websites  Our own https://webtide.com
  18. 18. Simone Bordet sbordet@webtide.com HTTP/2: Who
  19. 19. Simone Bordet sbordet@webtide.com HTTP/2: Who cURL & Wireshark  Unix tools support for HTTP/2 35+ Implementations  https://github.com/http2/http2-spec/wiki/Implementations Java, C, C++, Go, NodeJS, Erlang, Haskell, etc.
  20. 20. Simone Bordet sbordet@webtide.com HTTP/2: Java
  21. 21. Simone Bordet sbordet@webtide.com HTTP/2: Java No changes required to your WARs Existing web applications work out-of-the-box Push functionalities provided by servers and frameworks Possible action: remove old HTTP/1.1 hacks
  22. 22. Simone Bordet sbordet@webtide.com HTTP/2: Java HTTP/2 compliant servers require JDK 8  Due to the fact that HTTP/2 requires strong ciphers  Server-to-Server clear text may run on JDK 7 Servlet 4.0 will support HTTP/2  Backwards compatible  Few new API changes  New HTTP Push API
  23. 23. Simone Bordet sbordet@webtide.com HTTP/2: Java JEP 110 (http://openjdk.java.net/jeps/110)  HTTP/2 Client API proposal for JDK 9  http://cr.openjdk.java.net/~michaelm/8087112/2/ JEP 244 (http://openjdk.java.net/jeps/244)  TLS ALPN Extension for JDK 9 In the Java World:  Jetty (server + client) – Live @ https://webtide.com  Netty  Undertow  OkHttp (Android)
  24. 24. Simone Bordet sbordet@webtide.com HTTP/2: Java Jetty provides a pure HTTP/2 client Jetty's HttpClient provides a HTTP/2 transport  Applications use HttpClient high-level API // Standard HTTP/1.1 client new HttpClient(); // HTTP/2 transport client new HttpClient(new HttpClientTransportOverHTTP2());
  25. 25. Simone Bordet sbordet@webtide.com
  26. 26. Simone Bordet sbordet@webtide.com HTTP/2: Conclusions
  27. 27. Simone Bordet sbordet@webtide.com HTTP/2: Conclusions No changes for Web Developers  Servlet API backward compatible  Frameworks (JSF) will be able to leverage HTTP Push  No more domain sharding / spriting hacks needed  JDK 9 possibly updated to support HTTP 2.0 Some change for Deployers (devops / sysops)  TLS everywhere  Upgrade your Servlet Container  Jetty 9.3  Upgrade network infrastructure (e.g. load balancers)
  28. 28. Simone Bordet sbordet@webtide.com HTTP/2: Conclusions HTTP/2 Makes You Money Upgrade To Jetty :)
  29. 29. Simone Bordet sbordet@webtide.com Questions & Answers

×