svg-module icon indicating copy to clipboard operation
svg-module copied to clipboard

Base64 encoding increases size of original svg

Open fliptheweb opened this issue 3 years ago • 2 comments

Default 'url-loader' uses base64 encoding, but SVG content is a human-readable xml string, using base64 encoding is not mandatory. Better to use svg-url-loader (or something similar) instead for '?data' flag.

Benefits:

  • Resulting string is shorter (can be ~2 times shorter for 2K-sized icons);
  • Resulting string will be compressed better when using gzip compression;
  • Browser parses utf-8 encoded string faster than its base64 equivalent.

fliptheweb avatar Mar 24 '22 11:03 fliptheweb

This is an excellent idea! I'm afraid I don't have time to work on this - would you be interested in submitting a PR?

brhx avatar Apr 01 '22 12:04 brhx

@sam3d same story, if only will find the excess time🥲

If someone could implement that - feel free!

fliptheweb avatar Apr 01 '22 14:04 fliptheweb