Yastatic

HTTP/2 did not end bundling

Multiplexing removed the connection limit, not the cost of a request.

When HTTP/2 arrived, the advice was that bundling had become obsolete: requests are multiplexed over one connection, so two hundred small files cost the same as one large one. Years of measurements say otherwise.

Each request still carries headers, still needs a cache lookup, and still has to be discovered. Discovery is the expensive part. A module that imports a module that imports a module creates a chain of round trips that no amount of multiplexing can flatten.

Compression also works better on larger inputs. Twenty files compressed separately are noticeably bigger than the same code compressed as one.

The sensible middle ground is a handful of bundles split along the lines of how often they change: vendor code that is stable for months, application code that changes weekly, and page-specific code loaded on demand.

The protocol made the penalty for many requests smaller. It never made it zero.