wesaynih / infrastructure

© 2016 The Knights Who Say NIH — Do NOT fork this repository without permission.
http://frameless.io/
Other
0 stars 1 forks source link

Enable GZIP compression for some media types #61

Open Robbert opened 8 years ago

Robbert commented 8 years ago

First, we should create an extensive list, preferably in a JSON array:

[
  "application/xml",
  "application/xslt+xml",
  "image/svg+xml",
  "text/css",
  "text/html",
  "application/javascript",
  "application/json",
  "text/plain"
]

Then convert it to different types of configurations, such as .htaccess

AddOutputFilterByType DEFLATE application/json

Or:

# The TTF and EOT font formats don't have a mime type assigned,
# match by their filename extension instead.
<FilesMatch "\.(ttf|eot)$">
  SetOutputFilter DEFLATE
</FilesMatch>