3 ms·
No problem! > Is there a C implementation of it? Currently there's no good standalone version, because we're still at interop stage. Take a look at nghttp2[0]
by Lukasa 12y ago
No problem!
> Is there a C implementation of it?
Currently there's no good standalone version, because we're still at interop stage. Take a look at nghttp2[0], however. They've got a HPACK layer that I believe can be separated out. I've got a plan to actually do that work for them, but haven't had time to sit down and do it.
Nevertheless, theirs is the best implementation around at the moment in terms of compression efficiency. My own HTTP/2 library can optionally use it.
> Will all clients respect this, or will they start trying to send you HPACK requests anyway?
So we need to be clear on what this means. The actual binary format of headers via HPACK cannot be turned off. However, all the compression can be. This isn't optional: the other party must respect your preferences.
> So is this going to be yet another "your PC boots in 16-bit real mode in 2014", where servers have to keep switching from HTTP/1 to HTTP/2 on each new startup forevermore?
Hopefully no. Hopefully.
You're allowed to start straight away with HTTP/2 if you have some form of 'prior knowledge' that HTTP/2 will work. What 'prior knowledge' actually consists of is not entirely clear-cut, but in principle you can go straight to HTTP/2.
Note also that Upgrade: is only a problem for plaintext HTTP/2. If you use TLS, going to HTTP/2 is exactly as fast as going to HTTP/1.1 (because the negotiation is done at the same time as the TLS negotiation).
However, servers are clearly going to have to support HTTP/1.1 for a long time to come. This is unfortunate, but unavoidable.
[0]: http://nghttp2.org/ http://nghttp2.org/
- mohamedattahri 12y agoWhen you consider headers per request, we're talking bytes. But at the Internet scale, it's gigantic. Accept: image/gif, image/jpeg, image/pjpeg, application/x-ms-application, application/vnd.ms-xpsdocument, application/xaml+xml, application/x-ms-xbap, application/x-shockwave-flash, application/x-silverlight-2-b2, application/x-silverlight, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, / This is an Accept header on IE8 with Office installed. Back when it had over 55% of market share, Google alone estimated that as much as 38Gb of useless garbage internet traffic was sent its way every single day. And that was back when the Internet population was half was it is today, web apps were were primitive, and mobile and the network constraints were nascent.
- lucaspiller 12y agoFor the majority of requests I'd guess the Accept header isn't even used. Do people still write applications that send a PNG if supported, falling back to a GIF otherwise? Or use this to determine the user's language preference? I expect in most requests they are ignored and the server sends whatever it has. APIs would be the only thing I can think of, but even then you could get around that by having different endpoints for different formats. At the cost of saving a few TB (if not more) of Internet traffic a day it seems a fair trade off :-)
- wmf 12y agoContent negotiation is getting more popular with WebP, although mostly on large sites like Google and Facebook.