httpspdyhttp2

Does SPDY/HTTP2 concatenates responses?


I have a question about SPDY/HTTP2: Normally you concatenate multiple CSS and JS files into one file to save requests and to get a better performance. I heard that SPDY/HTTP2 combines multiple requests into a single response. Would that mean that I don't need to pre-concatenate CSS and JS files anymore, because this is handled by the protocol?

To say it in other words: Can I use <script source="moduleA.js"></script> and <script source="moduleB.js"></script> with SPDY/HTTP2 in the same way as I would use <script source="allScripts.js"></script> with HTTP1? Is this the same from a response performance point of view, but with the benefit of caching each file on its own, so that I can change moduleB.js and keep moduleA.js cached?


Solution

  • HTTP/2.0 does not (AFAIK) exist yet - it's still a proposed standard. But it seems likely that it will use similar connection handling to SPDY.

    SPDY doesn't concatenate them it multiplexes the requests across the same connection - from the network's point of view the effect is the same.

    Yes, you don't need to merge the content files by hand, yes they will be cached independently.