Page MenuHomePhabricator

Embedded SVG files should be optimized in ResourceLoader/CSSMin
Closed, DuplicatePublic

Description

SVG files embedded into CSS should be passed through svgo [1] or some similar SVG minification software first, to reduce size. (Ideally the same should happen for non-embedded files, but that seems more complicated.) Per [2], size reduction can be as much as 90%.

[1] https://github.com/svg/svgo
[2] https://gerrit.wikimedia.org/r/#/c/103894/


Version: 1.23.0
Severity: enhancement

Details

Reference
bz63491

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 3:11 AM
bzimport set Reference to bz63491.
bzimport added a subscriber: Unknown Object (MLST).

SVGO is too buggy to use transparently in its current version (see the long history of the patch you linked and https://gerrit.wikimedia.org/r/#/c/106506/ ).

Related: bug 59744.

What about using SVGO plus a post-processing script to fix the bugs? Right now, a lot of teams are minifying their SVGs locally, which not only makes them harder to edit later, but breaks the SVGs in many cases.

I don't think it's possible to write a script to recover information incorrectly deleted by svgo, we should rather fix its bugs.

  • This bug has been marked as a duplicate of bug 34812 ***