What are the pitfalls of using SVGZ instead of SVG?

I recently started using svg images on my sites. Some of them are complex and quite large, so I started to compress them. They compress very well.

Why not use non- SVGZ (instead of the uncompressed version)? Are there any well-known pitfalls that I should know about?

+4
source share
2 answers

As long as your web server sets the correct Content-Encoding HTTP header, it should work in all browsers that support SVG.

The only error that I know of is that you want to open svgz files from a local drive (i.e.: without using a web server). This does not work in all browsers.

In addition, if your svg files are large, then you should consider pre-processing them using SVG Scour or similar. It is quite common to see vector graphics editors such as Illustrator and Inkscape display redundant data in files (binary drops or custom xml markup).

+5
source

Is it for desktop browsers, mobile? I know that Opera supports SVGZ natively from 8.0 at least (maybe even earlier).

Which server? Apache, IIS? You may need to configure it and / or mess up .htaccess. Here's how for Apache: http://kaioa.com/node/45

Keep in mind that the server may already serve your content compressed if your client supports it, since SVGZ is a regular SVG using gzip compression.

+1
source

Source: https://habr.com/ru/post/1343905/


All Articles