Skip to content

Instantly share code, notes, and snippets.

@gmetais gmetais/gzip-conf.txt
Last active Jul 15, 2019

Embed
What would you like to do?
This is a list of Content-Type / mime-type for a server Gzip compression configuration
text/html
text/css
text/plain
text/xml
text/x-component
text/javascript
application/x-javascript
application/javascript
application/json
application/manifest+json
application/xml
application/xhtml+xml
application/rss+xml
application/atom+xml
application/vnd.ms-fontobject
application/x-font-ttf
application/x-font-opentype
application/x-font-truetype
image/svg+xml
image/x-icon
image/vnd.microsoft.icon
font/ttf
font/eot
font/otf
font/opentype
@webdesignberlin

This comment has been minimized.

Copy link

webdesignberlin commented May 7, 2015

text/vcard
font/eot
application/manifest+json

@gmetais

This comment has been minimized.

Copy link
Owner Author

gmetais commented May 7, 2015

Thanx @webdesignberlin !

What is text/vcard? Is it often found on a website?

@stefounet

This comment has been minimized.

Copy link

stefounet commented May 7, 2015

based on Fasterize conf:

application/x-font-opentype
application/x-font-truetype
font/opentype
font/otf
image/vnd.microsoft.icon

@gmetais

This comment has been minimized.

Copy link
Owner Author

gmetais commented May 7, 2015

The EOT font format is sometime compressed, not always.

The answer is unclear when it comes to Embedded OpenType (eot) fonts. It’s possible to compress EOT font files as part of the file creation process, in which case gzipping them is unnecessary. However, to generate compressed EOT font files requires a special tool and an extra step, so it’s likely that most of them are not pre-compressed. Examining the 460K .eot responses in the HTTP Archive shows that the website owner specifically gzipped them 79% of the time. Therefore, gzipping EOT fonts is a good default.
http://www.fastly.com/blog/new-gzip-settings-and-deciding-what-to-compress/

@jpvincent

This comment has been minimized.

Copy link

jpvincent commented Jun 8, 2015

ma conf en formation perf (+ la syntaxe Apache 2) :

activer mod_deflate mod_headers
SetOutputFilter DEFLATE
DeflateCompressionLevel 9

activer mod_filter

texte (plain), xml, javascript
AddOutputFilterByType DEFLATE text/*

JSON
AddOutputFilterByType DEFLATE application/json application/x-javascript application/javascript

fonts eot, ttf et .ico
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject application/x-font-ttf application/x-font-opentype application/x-font-truetype font/eot font/opentype font/otf

icones
AddOutputFilterByType DEFLATE image/x-icon image/vnd.microsoft.icon

XML
AddOutputFilterByType DEFLATE image/svg+xml application/xhtml+xml application/xml application/rss+xml application/atom_xml

@jpvincent

This comment has been minimized.

Copy link

jpvincent commented Jun 8, 2015

tu avais déjà tout trouvé en fait :)
Je mets juste un wildcard sur text/*

@ojdupuis

This comment has been minimized.

Copy link

ojdupuis commented Aug 18, 2015

merci messieurs ! C'est, juste ce que je cherchais

@bor8

This comment has been minimized.

Copy link

bor8 commented Jul 31, 2018

Attention, n'utilisez pas de text/* ! Ça ne marche pas. Précisez plutôt text/html etc. explicitement. Ça m'a pris une heure pour comprendre ça.

Achtung, bitte nicht text/* verwenden! Das funktioniert nicht. Lieber text/html usw. explizit angeben. Hat mich ne Stunde gekostet, dass herauszufinden.

Attention, please do not use text/*! This isn't working. Rather specify text/html etc. explicitly. Took me an hour to figure that out.

Apache 2.4.18.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.