Actually you do for performance. Http2 multiplexes the request in one tcp stream which makes it fast. In a way it's bundling by requesting assets in the same tcp connection.
Without http2 each request is a new tcp connection. And with how tcp works it has a slow start algorithm and so more connections slow it right down.
I think you and /u/dalore are talking about two separate things. They are already operating on the assumption that you’re only serving the required JS (for the most part at least).
On http1 it’s still better to serve a bundle containing, say, ScriptA + ScriptB + ScriptC + ScriptD across the whole site than it is to serve scripts A, B and C separately on a page where ScriptD is not required.
Of course there is a balance. Sometimes you have a large script that’s only used in one part of the site, so you wouldn’t include that in the main bundle.
I don't think you understand. Each request outside of http2 forms a new tcp connection. Tcp uses a slow start algorithm so that means it starts off slow. Those extra slow connections are going to kill performance.
With http2 it doesn't make new tcp connections but bundles the requests in the same tcp connection.
1
u/13steinj Jul 26 '18
Even without, no need to bundle.