top | item 35802855

(no title)

gondaloof | 2 years ago

> the overhead of multiple files is gone

Unfortunately not. Gzip is applied per-file and multiple small zips aren’t as compressed as a single zip.

Additionally, you get a cascade of downloads if you have multiple levels of imports, so it will download a file, parse it, download the its dependencies, etc.

Now this may not be a big deal in some cases, but the overhead is still not gone.

Side note: server push is gone so there’s no way to avoid the cascade.

> minify - i don’t care since i gzip anyway

That’s not how it works. The two things are complementary. Minification can drop a lot of dead code and comments, gzipping alone won’t do that.

discuss

order

aseipp|2 years ago

Frankly in the particular case where you have cascading downloads of small files, HTTP/1 is so unbelievably bad at that compared to HTTP/2 (especially in cases where the user-agent throttles TCP connections, like the limits of ~6 in a browser) that the "overhead" argument isn't really relevant because it might imply they're roughly comparable in some way. They aren't, in my experience, it's more like "Does it work" versus "Does it not work." I'm talking like one-or-two orders of magnitude in performance difference, in practice, in my cases.

Server push wasn't ever going to help use cases like this because pushing those files doesn't actually work very well; only the client knows about the state of its own cache (i.e. the server will aggressively push things even when the client doesn't need them). I tried making it work in some cases very similar to the "recursively download based on import structure" problem, and it was always just a complete wash in practice.

103 Early Hints are a better solution for that class of problem where the server has some knowledge over the request/response pattern and the "structure" of the objects its serving for download. They're also easier to support and implement, anyway.

thayne|2 years ago

Minification can also speed up parsing the code, since there is less code to parse.