IE8 and IE8 browsers are not SVG-enabled, SVGZ is a compressed format for SVG files, the configuration described in this article is browser-independent, but browsing svgz files is open in other modern browsers such as ie9+ or Firefox,chrome.
3 conditions are required for the browser to display the Svgz file normally:
1, the browser support SVG vector image format
2, the server set the correct response mime-type, that is, the HTTP response header contains Content-type:image/svg+xml
3, the server set the correct response content encoding type, the HTTP response header contains Content-encoding:gzip
This only applies to accessing the Svgz file from the Web server in the form of HTTP, and if you want to open the Svgz file of the local hard drive from the browser, it seems that the current chrome support is not supported by Ie/firefox.
Apache httpd configuration on the server Svgz Method 1: Add the configuration in the. htaccess file. Applies to settings only for a single site.
Add the following 2 lines in the appropriate location in the. htaccess file
AddType image/svg+xml svg svgzaddencoding gzip svgz
Method 2: Add the configuration in the httpd.conf file. Applies to server global, and can also be set for a single host.
Add the following lines in the httpd.conf file
<ifmodule mime_module> # SVG support AddType image/svg+xml. svg. svgz addencoding x-gzip. svgz</ Ifmodule>
Mime-type can also be configured in the Mime.types file, AddType addencoding can also be configured in other. conf files (such as vhosts.conf).
The above is through the Mime_module module configuration, in fact, can also be configured through the Headers_module module, example:
<ifmodule headers_module> <filesmatch "\.svgz$" > header set content-type image/svg+xml Header set content-encoding gzip </filesmatch></IfModule>
Exactly how to match, where, to see their own needs to be flexible processing.
Example of PHP program dynamic response Svgz file
<?phpheader (' Content-type:image/svg+xml '); header (' Content-encoding:gzip '); Echo file_get_contents (' Test.svgz ') );? >
Configure the HTTP headers required for the Svgz file for the Web server so that the browser can open the Svgz file