Why bundle optimizations are no longer a concern in HTTP/2

The bundling optimization was introduced as a “best practice” when using HTTP/1.1 because browsers could only open a limited number of connections to a particular domain. A typical web page has 30+ resources to download in order to be rendered. With HTTP/1.1, a browser opens 6 connections to the server, request 6 resources in parallel, … Read more

Curl: one-liner to test http/2 support

HTTP/2 supported: $ curl -sI https://curl.se -o/dev/null -w ‘%{http_version}\n’ 2 HTTP/2 not supported (instead serving 1.1 in this case): $ curl -sI http://curl.se -o/dev/null -w ‘%{http_version}\n’ 1.1 (curl 7.50.0 or later is required for this command line to work) HTTP/3 Since curl 7.88.1, if you build curl to support HTTP/3, the above one-liner can be … Read more

What is the difference between HTTP/1.1 pipelining and HTTP/2 multiplexing?

HTTP/1.1 without pipelining: Each HTTP request over the TCP connection must be responded to before the next request can be made. HTTP/1.1 with pipelining: Each HTTP request over the TCP connection may be made immediately without waiting for the previous request’s response to return. The responses will come back in the same order. HTTP/2 multiplexing: … Read more

Tomcat support for HTTP/2.0?

I’m the HTTP/2 implementer in Jetty, and I watch out other projects implementing HTTP/2. Tomcat’s Mark Thomas has outlined support for HTTP/2 for Tomcat 9. Update Jan 2017: Tomcat 8.5 supports HTTP/2 see @joe-aldrich answer https://stackoverflow.com/a/37889873/2027465 Considering that Servlet 4.0 is going to have as a target HTTP/2 support, and that HTTP/2 support requires ALPN … Read more

Does minifying and concatenating JS/CSS files, and using sprites for images still provide performance benefits when using HTTP/2?

They’re still useful. HTTP/2 reduces the impact of some of these practices, but it doesn’t eliminate their impact. Minification remains as useful as ever. Although HTTP/2 introduces new compression for message headers, that has nothing to do with minification (which is about message bodies). The compression algorithms for message bodies are the same, so minification … Read more

REST API with HTTP/2

The main semantic of HTTP has been retained in HTTP/2. This means that it still has HTTP methods such as GET, POST, etc., HTTP headers, and URIs to identify resources. What has changed in HTTP/2 with respect to HTTP/1.1 is the way the HTTP semantic (e.g. “I want to PUT resource /foo on host example.com“) … Read more

Is the per-host connection limit raised with HTTP/2?

Browsers impose a per-domain limit of 6-8 connections when using HTTP/1.1, depending on the browser implementation. This allows at most 6-8 concurrent requests per domain. With HTTP/2, browsers open only 1 connection per domain. However, thanks to the multiplexing feature of the HTTP/2 protocol, the number of concurrent requests per domain is not limited to … Read more

Enable HTTP2 with Tomcat in Spring Boot

In Spring Boot 2.1 and above it is as simple as adding this property to your .properties (or .yml) file: server.http2.enabled=true You can also do it programmatically like this (in one of your configuration classes): @Bean public ConfigurableServletWebServerFactory tomcatCustomizer() { TomcatServletWebServerFactory factory = new TomcatServletWebServerFactory(); factory.addConnectorCustomizers(connector -> connector.addUpgradeProtocol(new Http2Protocol())); return factory; }