3 ms·
Compressing an already-compressed file can make it bigger due to metainfo and the fact the gzip algorithm isn't optimised as well for images as say, jpeg. Furth
by mmahemoff 14y ago
Compressing an already-compressed file can make it bigger due to metainfo and the fact the gzip algorithm isn't optimised as well for images as say, jpeg. Furthermore, it's an unnecessary performance overhead on both server and browser (even regular compression is sometimes undesirable for this reason).
I guess the browsers figure it's not worth building in support for a feature that's rarely used and creates a sub-optimal UX.
- andreasvc 14y agoIt's not a matter of optimization. Compression removes redundancy. A compressed file will have very little redundancy, so compressing it again is largely a waste of CPU cycles. This is supported by mathematical principles (cf. information theory).
- colanderman 14y ago> Compressing an already-compressed file can make it bigger due to metainfo That's not why, that's just a reason why doing so is silly. > the gzip algorithm isn't optimised as well for images as say, jpeg. gzip is used in PNG. Read the article; the reason is because he wasn't sending gzip data, just deflate data.