Created
June 8, 2013 07:24
-
-
Save brycefisher/5734403 to your computer and use it in GitHub Desktop.
Supercharge your DIY CDN with mod_expires, mod_deflate, and then lock it down a bit.
This file contains hidden or 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
| # Security | |
| Options -Indexes | |
| <IfModule mod_rewrite.c> | |
| RewriteEngine On | |
| RewriteRule \.bat$ - [R=404] | |
| </IfModule> | |
| # Leverage Browser Caching | |
| <IfModule mod_expires.c> | |
| # Enable Expirations | |
| ExpiresActive On | |
| # Default Expiration Time | |
| ExpiresDefault "access plus 1 month" | |
| # Expiration for Images | |
| ExpiresByType image/gif "access plus 1 month" | |
| ExpiresByType image/png "access plus 1 month" | |
| ExpiresByType image/jpg "access plus 1 month" | |
| ExpiresByType image/jpeg "access plus 1 month" | |
| # Expiration for CSS | |
| ExpiresByType text/css "access plus 1 month" | |
| # Expiration for JavaScript | |
| ExpiresByType application/javascript "access plus 1 month" | |
| </IfModule> | |
| # Gzip | |
| <ifmodule mod_deflate.c> | |
| AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript text/javascript | |
| </ifmodule> | |
| #End Gzip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment