Skip to content

Instantly share code, notes, and snippets.

@roberto-butti
Created March 3, 2016 15:50
Show Gist options
  • Save roberto-butti/7f86f4140fb07ea3173d to your computer and use it in GitHub Desktop.
Save roberto-butti/7f86f4140fb07ea3173d to your computer and use it in GitHub Desktop.
.htaccess for mod_expires and mod_deflate
<IfModule mod_expires.c>
ExpiresActive on
# Your document html
ExpiresByType text/html "access plus 1 month"
# Media: images, video, audio
ExpiresByType audio/ogg "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType video/mp4 "access plus 1 month"
ExpiresByType video/ogg "access plus 1 month"
ExpiresByType video/webm "access plus 1 month"
ExpiresByType application/font-woff "access plus 1 month"
# CSS and JavaScript
ExpiresByType application/javascript "access plus 1 month"
ExpiresByType text/css "access plus 1 month"
</IfModule>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment