Are there any plans to support HTTP/2 in the Couchbase Lite replication interface? The efficiencies that HTTP/2 offers would be cool for mobile apps.
In our system, we are using Couchbase Lite to replicate with CouchDB 2.0 through a custom proxy, so our system could theoretically support HTTP/2 requests from mobile clients before CouchDB itself does (I assume a situation story for the Sync Gateway).
Sync Gateway has experimental support for HTTP/2; there’s a property you can add to the config file in the unsupported namespace to enable it (sorry, I don’t have the details handy.)
The bigger issue is HTTP/2 support on the client platforms.
iOS 9+ transparently supports HTTP/2. However, I ran into some weird bugs/crashes while testing CBL with an instance of SG with HTTP/2 enabled back in 2015(?), which as far as I could tell seemed to be bugs in Apple’s HTTP/2 implementation. That’s actually the primary reason why HTTP/2 isn’t enabled by default on SG. This was on iOS 9; I have not retested with iOS 10, so it’s possible that those bugs (if they’re Apple’s) have been fixed.
CBL Android/Java uses OkHttp as a HTTP client library, which supports HTTP/2 since v1.3.0 (according to @hideki)
.NET doesn’t support HTTP/2 until version 4.6.x, which we can’t upgrade to yet. It’s also unclear whether Mono supports it.
If you were to edit your SG config to enable HTTP/2, mobile apps on iOS would immediately start to use it. I don’t know if that’s true of Android or whether CBL would have to be modified to enable it. You’re welcome to try this, but it’s an unsupported configuration and I’d urge you to do a lot of testing. If you do, please let us know your results, good or bad.
Thanks for the info! I’ll take a look at the Android client to see if we can get it talking HTTP/2. We aren’t using the Sync Gateway in our system, but we do have a custom replication proxy in front of CouchDB 2.0, which we could get to talk HTTP/2 with our clients (I’m playing with http2 in node now).
I’ll let you guys know what I am able to get working.