Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 292357

SVGZ isn't served with correct encoding

$
0
0

https://en.wikipedia.org/wiki/Scalable_Vector_Graphics#Compression

SVG images, being XML, contain many repeated fragments of text, so they are well suited for lossless data compression algorithms. When an SVG image has been compressed with the industry standard gzip algorithm, it is referred to as an "SVGZ" image and uses the corresponding .svgz filename extension. Conforming SVG 1.1 viewers will display compressed images.[8] An SVGZ file is typically 20 to 50 percent of the original size.[9] W3C provides SVGZ files to test for conformance.[10]

Every web browser that supports SVG supports SVGZ as it is just a standard gzip HTTP encoding.

Having this in core means that every contrib developer can have confidence that SVGZ will work.

The attached patch also converts every .svg file in core to .svgz

Problem/Motivation

Drupal is not serving SVGZ files with the correct encoding.

Proposed resolution

All that is required is for these two lines to be added to .htaccess as described here: http://kaioa.com/node/45

AddType image/svg+xml svg svgz
AddEncoding gzip svgz

nginx can also be configured to serve SVGZ correctly. At my request, Pantheon have already updated their nginx configuration to support it and I have confirmed that it works.

I have also modified web.config for IIS as described here: http://forums.iis.net/t/1175276.aspx

Remaining tasks

none


Viewing all articles
Browse latest Browse all 292357

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>