Re: [svgwg] A separate MIME type for svgz files is needed (#701)

In the early days of the Web, the distinction between the type and the encoding was not clear. So for example a MIME type was registered for zip archives, and another one for gzipped files (application/gzip). This was a bad design.

The decision (from memory, around 1997-8) to use a single Internet Media Type (MIME type) for SVG and to use Content-Encoding to indicate the presence of compression (whether on-the-fly compression or static compression generated by some authoring tool) was thus result of experience in th eIETF and W3C, and the specific registration benefited from feedback from the IETF, and remains a sound architecture to this day.

In the early days, most servers did not do on the fly compression. There was a need for authoring tools to be able to emit the compressed form and for content creators who did not have control over server configuration to get the correct result. Which is why `.svgz` was standardized.

Nowadays, on the fly encoding is common and indeed there are several types (such as Brotli encoding, which does a better job on SVG than gzip). So nowadays on many servers the performance gain can be realized by just dropping a `.svg` file onto the server.

But using `.svgz` files is a long established practice, and works well. 

Your suggested change would simply have the effect that there would be a new Internet Media type with no support, so people would not use it as the images would not be displayed.

As @longsonr said, a complete duplication of Internet Media types is a very poor solution.

@mqudsi said:
> More practically speaking, a browser served a svgz file as generated by the myriad of SVG editors/compressors/optimizers/etc without a gzip Content-Encoding will not be able to render the image due to broken encoding

Correct. And that would indicate an error in the filetype mapping on that server. `.svgz` means **both** Content-Type and Content-Encoding should be set. And I know that Apache can be set to do that (indeed, I thought is was the default mapping out of the box). So this is not a problem that seems to occur much in practice, and your suggested solution would not solve it. Instead, just ensure the server is configured correctly.

-- 
GitHub Notification of comment by svgeesus
Please view or discuss this issue at https://github.com/w3c/svgwg/issues/701#issuecomment-505175428 using your GitHub account

Received on Monday, 24 June 2019 20:49:30 UTC