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.
0
u/13steinj Jul 26 '18
None of what you said requires bundling of resources. All it requires is correctly splitting up resources.