Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I ran the examples in the article through gzip. The long one is 789 bytes compressed, and the short one is 266 bytes compressed.

The reality is that while text compresses well, gzip doesn't know what data is relevant. It keeps it all. So for this example, the original long svg contains things like inkscape configuration (the window height, the current layer name, etc.) while the shorter one omits all that. So not emitting that information will always be more efficient than emitting that information and compressing it.



He means in addition to minifying the SVG, you should compress it for transport (which is likely happening already depending on how you serve it)


Of course, but even the minified versions should net some benefits with compression. Most SVGs probably fit in 7-bit ASCII, which on itself should lead to improvements via (Huffman?) compression. Importantly, as was pointed out, I say “also” not “instead.”




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: