Skip to content

Instantly share code, notes, and snippets.

@fduran
Created December 12, 2012 21:54
Show Gist options
  • Save fduran/4271982 to your computer and use it in GitHub Desktop.
Save fduran/4271982 to your computer and use it in GitHub Desktop.
Apache2 optimization
# www.fduran.com
# Apache2 optimization
# apache-wide (/etc/apache2/apache2.config ):
# compression
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4\.0[678] no-gzip
BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
# Etags
Header unset ETag
FileETag None
# Per <VirtualHost> /etc/apache2/sites-enabled/somesite :
<LocationMatch "\.(css|js|jpg|gif|png|pdf|ico)$">
Header set Cache-Control "max-age=290304000, public"
</LocationMatch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment