Skip to content

Instantly share code, notes, and snippets.

@jcraane
Created November 17, 2015 08:37
Show Gist options
  • Save jcraane/d0c3490955d3c66f2cdf to your computer and use it in GitHub Desktop.
Save jcraane/d0c3490955d3c66f2cdf to your computer and use it in GitHub Desktop.
SetOutputFilter DEFLATE
# mod_deflate configuration
<IfModule mod_deflate.c>
# Restrict compression to these MIME types
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/json
AddOutputFilterByType DEFLATE application/xml+rss
AddOutputFilterByType DEFLATE application/x-javascript
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/css
<IfModule mod_headers.c>
# Make sure proxies don't deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</IfModule>
</IfModule>
@jcraane
Copy link
Author

jcraane commented Nov 17, 2015

Config file to be put in webapp/.ebextentions to enable gzip on Elastic Beanstalk apache config. To actually apply this config add the following config file to the .ebextentions folder (named my-app.config):

container_commands:
01_setup_apache:
command: "cp .ebextensions/enable_mod_deflate.conf /etc/httpd/conf.d/enable_mod_deflate.conf"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment