Created
February 20, 2013 17:10
-
-
Save n8kowald/4997158 to your computer and use it in GitHub Desktop.
.htaccess - Improve performance by copying and pasting this into your .htaccess (or better yet your VirtualHost config)
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
# Compress text, html, javascript, css, xml: | |
<IfModule mod_deflate.c> | |
AddOutputFilterByType DEFLATE text/text | |
AddOutputFilterByType DEFLATE text/plain | |
AddOutputFilterByType DEFLATE text/html | |
AddOutputFilterByType DEFLATE text/xml | |
AddOutputFilterByType DEFLATE text/css | |
AddOutputFilterByType DEFLATE text/javascript | |
AddOutputFilterByType DEFLATE application/xml | |
AddOutputFilterByType DEFLATE application/xhtml+xml | |
AddOutputFilterByType DEFLATE application/rss+xml | |
AddOutputFilterByType DEFLATE application/javascript | |
AddOutputFilterByType DEFLATE application/x-javascript | |
</IfModule> | |
# Turn on Expires and set default to 0 | |
ExpiresActive On | |
ExpiresDefault A0 | |
# Set up caching on media files for 1 week | |
<filesMatch "\.(xml|txt|html|js|css)$"> | |
ExpiresDefault A604800 | |
</filesMatch> | |
# Set up caching on media files for 1 week | |
<filesMatch "\.(gif|jpg|jpeg|png|swf)$"> | |
ExpiresDefault A604800 | |
</filesMatch> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment