3 ms·
Don’t forget to also use GZip or another transport compression on them as well. Text tends to compress well, and can net additional benefits on top of minificat
by jchw 7y ago
Don’t forget to also use GZip or another transport compression on them as well. Text tends to compress well, and can net additional benefits on top of minification.
- jrockway 7y agoI 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.
- penagwin 7y agoHe means in addition to minifying the SVG, you should compress it for transport (which is likely happening already depending on how you serve it)
- jchw 7y agoOf 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.”