Created
May 20, 2011 05:32
-
-
Save ariela/982410 to your computer and use it in GitHub Desktop.
各リソースをgz圧縮して転送量を抑える
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
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteCond %{HTTP:Accept-Encoding} gzip | |
RewriteCond %{REQUEST_FILENAME} !.gz$ | |
RewriteCond %{REQUEST_FILENAME}.gz -s | |
RewriteRule .+ %{REQUEST_URI}.gz | |
<FilesMatch ".html.gz$"> | |
ForceType text/html | |
AddEncoding x-gzip .gz | |
</FilesMatch> | |
<FilesMatch ".txt.gz$"> | |
ForceType text/plain | |
AddEncoding x-gzip .gz | |
</FilesMatch> | |
<FilesMatch ".js.gz$"> | |
ForceType application/x-javascript | |
AddEncoding x-gzip .gz | |
</FilesMatch> | |
<FilesMatch ".css.gz$"> | |
ForceType text/css | |
AddEncoding x-gzip .gz | |
</FilesMatch> | |
</IfModule> |
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
ExpiresActive on | |
ExpiresDefault "access plus 1 month" | |
FileETag None |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment