Interview: HTTP 2 explained by Google’s Surma
We had the chance to meet and interview a lot of very interesting Googler’s during the last Google I/O. Today it was Surma ! We’ll release those interviews (mostly in English) in the upcoming days.
Wassim Chegham: Hello, can you introduce yourself?
Surma: My name is Surma, I work for Google in London, I work on the Chrome team, in developer relations, so basically my job is to reach out to developers, tell them when we get new things, and they tell me what we are doing wrong, so we can change either Chrome or the Web or our strategy, these kinds of things.
So do you get feedback about HTTP 2?
Yes! Actually I’m one of the main people in DevRel to work on HTTP 2 and public messaging about HTTP 2.
Awesome! Can you explain to us what is HTTP2?
Surma, would you say it’s a game changer?
For developers, yes, for users, it is basically unnoticeable. Everything works the same but there are a few things to know: it is always encrypted. Technically there is an unencrypted version of HTTP 2 but no browser supports it. It is a very conscious decision because we want everyone to use TLS. Things load faster even websites that have not been optimized for HTTP 2. Even those have a big performance benefits.
So for the user, actually nothing changes. And also, it’s backwards compatible so everything works the same as before.
So, it is a stable API?
It is stable, the spec is finalized. All the evergreen browsers support it. So this means 88% of the web traffic would be HTTP 2 capable. People should start moving over to it as soon as possible.
You can start using HTTP2 right now?
You can and you should.
Speaking about developers, how would developers migrate from HTTP 1 to HTTP 2?
There are multiple approaches you can take here. There is the very easy “I just want to have it” approach which would be using something like Cloudflare. You put it in front of your server and they basically translate your old HTTP 1 into the new HTTP 2. That is actually already pretty good because you can reap almost all the benefits with this version already. One of the biggest drawbacks of HTTP 1 is you can have at most 6 open connections but this is something the browser enforces and CloudFlare can have much more. So it will basically open us as many connections as it needs, get all the documents, caching them for you as well because they are a CDN, right? And use it with the new HTTP 2 way which is a single connection and works way more efficiently…
But if you don’t use CloudFlare?
If you don’t use CloudFlare, it depends on what stack you’re using. If you’re using Apache or NginX, you got it, they support HTTP 2 now. Update to the new version, adjust your configuration. I wrote a blog post about this. If you’re using something without a front-end… what is it called… the load balancer…
HAProxy! Thank you. I don’t think they have support just yet. Sometimes, you have this single app which is just using the HTTP server of the language. I think Node has bindings, Go has bindings or has an HTTP 2 server, so does Node…
Java… has one actually — that is also on my blog post [laughs]. Some languages are still very much in development. They don’t expose all the features, some new features in HTTP 2 that HTTP 1 didn’t have. But to be fair, I’ll ignore them for now.
Speaking about features, what is the killer one for you?
Do you have something to add about HTTP 2?
The biggest part is, if you’re trying to convince people to use HTTP 2, the CloudFlare way would be the way where almost no effort is involved. It will still make your app better and you don’t have to worry about excluding users because it’s backward compatible, if you don’t support it, it will still work just as before. So, there is no downside really. The only thing where we might have to measure a bit is when you say you stop making all concatenation, because requests are cheap, but they are not free. So make benchmarks before and after, but I guarantee you, 99% the time, you’re gonna do better than before without any effort…
So, you don’t have to do anything on the client…
Nothing. Your web app logic doesn’t care. The semantics stays the same. The request method: GET, POST, UPDATE, etc. You have headers, you have the body. Everything stays the same. Just the way it goes over the wire has changed.
Thank you Surma!
Note: Surma also gave a very good talk about Houdini at Google I/O, you can watch it here :