Created
April 30, 2014 18:37
-
-
Save rxnlabs/efb36259524df392977d to your computer and use it in GitHub Desktop.
htaccess - cache static files for one month and add gzip for performance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#add caching headers for static files. tell browser to cache for one month | |
<FilesMatch "(?i)^.*\.(ico|flv|jpg|jpeg|png|gif|js|css)$"> | |
ExpiresActive On | |
ExpiresDefault A2592000 | |
</FilesMatch> | |
#add gzip to site | |
<IfModule mod_deflate.c> | |
<IfModule mod_filter.c> | |
AddOutputFilterByType DEFLATE text/plain text/html application/x-httpd-php-source | |
AddOutputFilterByType DEFLATE text/xml application/xml application/xhtml+xml application/xml-dtd | |
AddOutputFilterByType DEFLATE application/rdf+xml application/rss+xml application/atom+xml image/svg+xml | |
AddOutputFilterByType DEFLATE text/css text/javascript application/javascript application/x-javascript | |
AddOutputFilterByType DEFLATE font/truetype application/x-font-ttf font/opentype application/x-font-otf | |
</IfModule> | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment