From: Jan van Hellemond Date: Sat, 6 Feb 2016 14:13:04 +0000 (+0100) Subject: Added SVG to compressible mime types X-Git-Tag: v4.4.0b1~56 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4cd47d666c9665c08b0ef1f8e12c42c871360d8c;p=thirdparty%2Ftornado.git Added SVG to compressible mime types This adds the mime type `image/svg+xml` to the whitelist of compressible mime types for the tornado.web.GZipContentEncoding class. SVG images are served with the mime type `image/svg+xml`, but are not compressed by the GZipContentEncoding transform. My first thought was to add all mime types ending with `+xml`, but that might need a bit more research. --- diff --git a/tornado/web.py b/tornado/web.py index c51d5f68a..fd971a8ca 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -2713,7 +2713,8 @@ class GZipContentEncoding(OutputTransform): # beginning with "text/"). CONTENT_TYPES = set(["application/javascript", "application/x-javascript", "application/xml", "application/atom+xml", - "application/json", "application/xhtml+xml"]) + "application/json", "application/xhtml+xml", + "image/svg+xml"]) # Python's GzipFile defaults to level 9, while most other gzip # tools (including gzip itself) default to 6, which is probably a # better CPU/size tradeoff.