Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Base64 encoding increases size of original svg #90

Open
fliptheweb opened this issue Mar 24, 2022 · 2 comments
Open

Base64 encoding increases size of original svg #90

fliptheweb opened this issue Mar 24, 2022 · 2 comments

Comments

@fliptheweb
Copy link

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.
@sam3d
Copy link
Collaborator

sam3d commented Apr 1, 2022

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?

@fliptheweb
Copy link
Author

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

If someone could implement that - feel free!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants