Last active
August 29, 2015 14:08
-
-
Save alfredbez/81b60cbcfd907abf09c9 to your computer and use it in GitHub Desktop.
use .gz version if available (works with js, css & html files)
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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{HTTP:Accept-Encoding} gzip | |
RewriteCond %{REQUEST_FILENAME}.gz -f | |
RewriteRule (.*)$ $1.gz [L] | |
</IfModule> | |
<FilesMatch ".(js.gz)$"> | |
AddType text/javascript .gz | |
AddEncoding x-gzip .gz | |
</FilesMatch> | |
<FilesMatch ".(css.gz)$"> | |
AddType text/css .gz | |
AddEncoding x-gzip .gz | |
</FilesMatch> | |
<FilesMatch ".(html.gz)$"> | |
AddType text/html .gz | |
AddEncoding x-gzip .gz | |
</FilesMatch> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I use gulp-gzip to generate the .gz-files