Skip to content

Instantly share code, notes, and snippets.

@stevetrask
Created July 20, 2015 18:24
Show Gist options
  • Save stevetrask/5cc6c86d706022be7752 to your computer and use it in GitHub Desktop.
Save stevetrask/5cc6c86d706022be7752 to your computer and use it in GitHub Desktop.
# pass the default character set
AddDefaultCharset utf-8
<IfModule mod_headers.c>
<FilesMatch ".(js|css|xml|gz|html|svg)$">
Header append Vary: Accept-Encoding
Header set Connection keep-alive
</FilesMatch>
</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/css "access 1 month"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType text/javascript "access 1 week"
ExpiresByType application/pdf "access 1 year"
ExpiresDefault "access 7 days"
</IfModule>
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment