I started playing around with HTTP/2, seeing as all major browsers already support it or are going to support it very soon. It makes a lot of things easier with sending multiple files to the client so could possibly make file injections easier/faster.
There's a great module for that, https://github.com/molnarg/node-http2, which seems to be backwards compatible with node's HTTP module and supports old browsers/clients as well.
What do you think?
@Globegitter looks great!
We don't do anything fancy with server atm, so I imagine this could be just a drop-in replacement.
I'm really glad if Node itself has HTTP/2 support, and it's discussed in https://github.com/nodejs/NG/issues/8.
+1 - would really love to see HTTP/2 support. Sounds like it could be really easy by using node-http2 as noted by @Globegitter
:+1:
:+1:
+1
:+1:
+1
+1
+1
+1
+1
Serving many many files in develop this would save me A LOT of time
Any updates? :D
+1
@zakjan Please use reactions now, instead of +1 comments.
+1
Progress on this one?
Any word on this? It would really help given that I'm using System.js and it's making tons of XHR requests.
The only hold up here is the fact I've never used, or even played around with any HTTP2 implementations yet.
If someone wants to send a PR with changes to https://github.com/BrowserSync/browser-sync/blob/master/lib/server/utils.js#L34-L47 I'd be more than happy to merge it.
@shakyShane I will try my best to open pull request with HTTP/2 today. From my understanding, we just need to generate a key and certificate and add it to an options object when using the http2.createServer function. I've already identified where it's being used (utils.js).
@lgdexter There is a dummy default certificate for HTTPS, you can use the same for HTTP2.
+1
Would really love to be able to test my app's loading performance in development in browser-sync in both http and http/2!
For the love of god, please stop commenting just +1, just use the emoji reactions please
I have got http2 working with express and to be honest it was actually slower serving 1000 javascript files than over regular http. Am hugely dissapointed by this.
@el-davo Is your app an SPA? What dependency loading library do you use?
Yes I am using angularjs with systemjs and jspm. The http2 library's is node-http2 with connect server
@el-davo To gain the performance of http2 you can try the depcache functionality of jspm
Thanks! I will give that a go today and report back
Just tried it there. That method shaves about 3 seconds roughly off loading time. thanks @amitev . Every little helps :). In case anyone wants to try it heres the server am using
var connect = require('connect');
var app = connect();
var fs = require('fs');
var serveStatic = require('serve-static');
require('events').EventEmitter.prototype._maxListeners = 1000000;
app.use('/', serveStatic(__dirname + '/'));
var options = {
key: fs.readFileSync('./gulp/localhost.key'),
cert: fs.readFileSync('./gulp/localhost.crt')
};
require('http2').createServer(options, app).listen(8001);
+1
Most helpful comment
For the love of god, please stop commenting just +1, just use the emoji reactions please