I'm working in SVG and just read about the compressed file 'SVGZ' format. As it makes our file sizes a lot smaller, I'm quite keen on using it in our web application, however the browsers do not appear to support the format. Can anyone point to any documentation on how to use SVGZ files instead of SVG in online documents/ apps.
3 Answers
SVGZ
is just a gzipped SVG
, see this.
Note: Not all browser support SVGZ
. Your HTTP server may probably compresses its response with deflate, which have the same performance.
-
19All browsers support SVGZ when served with the proper HTTP headers. – Erik Dahlström Jan 19 '11 at 15:27
-
2Er, aren’t there actually a small number of browsers that can’t do gzip, Erik? – Alan H. Jun 07 '12 at 01:20
-
1Erik, by all browsers, do you also mean older ones — say IE8? – Baumr Nov 05 '12 at 16:20
-
5IE8 doesn't support SVG, so it makes no sense to try gzip (for SVGZ). http://caniuse.com/svg – ayke Mar 17 '13 at 15:10
-
5Compressing with deflate each time a SVG file is sent does not have the same performance and ressource usage on server. – bokan Feb 27 '14 at 10:02
-
The link is outdated. See also http://www.w3.org/TR/SVG11/intro.html#MIMEType – user123444555621 Mar 26 '14 at 08:36
-
@bokan, web servers keep compressed outputs at a cache, at least IIS does. So they're not compressed each time they are served. – Blameself Mar 27 '20 at 08:23
As SVG is just plain-text you are able to send it from your server in a compressed format.
Enable Gzip Compression on Apache
Look into gzip/deflate compression for your particular http server, the support for compression in browsers is very good at the moment.

- 11,743
- 10
- 52
- 81

- 8,236
- 3
- 28
- 31
Also SVGZ files cannot be opened locally by Firefox 19.0.2 or IE 9.0.8112, however, Google Chrome can. This doesn't necessarily effect people viewing it through your browser since it ought to work if you set the right mime-type, but if they download it they will not be able to open it regularily (until they un-gzip it of course).

- 18,541
- 27
- 119
- 168
-
3Also Firefox 27.0 and IE 11.0 cannot open local svgz files. However, Chrome and Opera can. – cuixiping Feb 26 '14 at 12:21