Commit 9ea63a04b8e589a108f94d3f4e642139579fc215
1 parent
eae531ec
gzip2
Showing
1 changed file
with
19 additions
and
27 deletions
Show diff stats
.htaccess
... | ... | @@ -43,33 +43,25 @@ AddDefaultCharset utf-8 |
43 | 43 | RewriteRule \.(htaccess|htpasswd|svn|git) - [F] |
44 | 44 | </IfModule> |
45 | 45 | |
46 | -<IfModule mod_headers.c> | |
47 | - # Serve gzip compressed CSS files if they exist | |
48 | - # and the client accepts gzip. | |
49 | - RewriteCond "%{HTTP:Accept-encoding}" "gzip" | |
50 | - RewriteCond "%{REQUEST_FILENAME}\.gz" -s | |
51 | - RewriteRule "^(.*)\.css" "$1\.css\.gz" [QSA] | |
52 | - | |
53 | - # Serve gzip compressed JS files if they exist | |
54 | - # and the client accepts gzip. | |
55 | - RewriteCond "%{HTTP:Accept-encoding}" "gzip" | |
56 | - RewriteCond "%{REQUEST_FILENAME}\.gz" -s | |
57 | - RewriteRule "^(.*)\.js" "$1\.js\.gz" [QSA] | |
58 | - | |
59 | - | |
60 | - # Serve correct content types, and prevent mod_deflate double gzip. | |
61 | - RewriteRule "\.css\.gz$" "-" [T=text/css,E=no-gzip:1] | |
62 | - RewriteRule "\.js\.gz$" "-" [T=text/javascript,E=no-gzip:1] | |
63 | - | |
64 | - | |
65 | - <FilesMatch "(\.js\.gz|\.css\.gz)$"> | |
66 | - # Serve correct encoding type. | |
67 | - Header append Content-Encoding gzip | |
68 | - | |
69 | - # Force proxies to cache gzipped & | |
70 | - # non-gzipped css/js files separately. | |
71 | - Header append Vary Accept-Encoding | |
72 | - </FilesMatch> | |
46 | +<IfModule mod_deflate.c> | |
47 | + AddOutputFilterByType DEFLATE text/plain | |
48 | + AddOutputFilterByType DEFLATE text/html | |
49 | + AddOutputFilterByType DEFLATE text/xml | |
50 | + AddOutputFilterByType DEFLATE text/css | |
51 | + AddOutputFilterByType DEFLATE application/xml | |
52 | + AddOutputFilterByType DEFLATE application/xhtml+xml | |
53 | + AddOutputFilterByType DEFLATE application/rss+xml | |
54 | + AddOutputFilterByType DEFLATE application/javascript | |
55 | + AddOutputFilterByType DEFLATE application/x-javascript | |
56 | + BrowserMatch ^Mozilla/4 gzip-only-text/html | |
57 | + BrowserMatch ^Mozilla/4\.0[678] no-gzip | |
58 | + BrowserMatch \bMSIE !no-gzip !gzip-only-text/html | |
59 | + Header append Vary User-Agent | |
60 | + RewriteEngine On | |
61 | + AddEncoding gzip .gz | |
62 | + RewriteCond %{HTTP:Accept-encoding} gzip | |
63 | + RewriteCond %{REQUEST_FILENAME}.gz -f | |
64 | + RewriteRule ^(.*)$ $1.gz [QSA,L] | |
73 | 65 | </IfModule> |
74 | 66 | |
75 | 67 | <IfModule mod_expires.c> | ... | ... |