SVG image upload optimization

1

I'm creating a site that contains several SVG images. I've tried to create a sprite with some images and embed it right in the CSS (background-image).

After searching for several days, I could not find any solution to improve image loading that works on all browsers (IE10 +) and does not have to download dozens of files.

How could I optimize image upload in SVG?

    
asked by anonymous 27.07.2018 / 21:17

1 answer

1

There are some techniques, but the basis is to eliminate unnecessary code from within SVG and minify the final file.

This option is to treat the .svg file before it is required ok. It does not handle the server request, but rather the size of the file that will be downloaded from the server.

There are online services like SVGOMG that help you clean SVG. You get a reduction of about 60% in the final size of the files. link

Example of use. Notice the list of attributes that you can change and remove the right.

ThisistheirprojectinGit: link

    
27.07.2018 / 21:35