From 9ea63a04b8e589a108f94d3f4e642139579fc215 Mon Sep 17 00:00:00 2001 From: timur Date: Mon, 20 Nov 2017 19:16:37 +0200 Subject: [PATCH] gzip2 --- .htaccess | 46 +++++++++++++++++++--------------------------- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/.htaccess b/.htaccess index cbe72c6..bc44a74 100755 --- a/.htaccess +++ b/.htaccess @@ -43,33 +43,25 @@ AddDefaultCharset utf-8 RewriteRule \.(htaccess|htpasswd|svn|git) - [F] - - # Serve gzip compressed CSS files if they exist - # and the client accepts gzip. - RewriteCond "%{HTTP:Accept-encoding}" "gzip" - RewriteCond "%{REQUEST_FILENAME}\.gz" -s - RewriteRule "^(.*)\.css" "$1\.css\.gz" [QSA] - - # Serve gzip compressed JS files if they exist - # and the client accepts gzip. - RewriteCond "%{HTTP:Accept-encoding}" "gzip" - RewriteCond "%{REQUEST_FILENAME}\.gz" -s - RewriteRule "^(.*)\.js" "$1\.js\.gz" [QSA] - - - # Serve correct content types, and prevent mod_deflate double gzip. - RewriteRule "\.css\.gz$" "-" [T=text/css,E=no-gzip:1] - RewriteRule "\.js\.gz$" "-" [T=text/javascript,E=no-gzip:1] - - - - # Serve correct encoding type. - Header append Content-Encoding gzip - - # Force proxies to cache gzipped & - # non-gzipped css/js files separately. - Header append Vary Accept-Encoding - + + AddOutputFilterByType DEFLATE text/plain + AddOutputFilterByType DEFLATE text/html + AddOutputFilterByType DEFLATE text/xml + AddOutputFilterByType DEFLATE text/css + AddOutputFilterByType DEFLATE application/xml + AddOutputFilterByType DEFLATE application/xhtml+xml + AddOutputFilterByType DEFLATE application/rss+xml + AddOutputFilterByType DEFLATE application/javascript + AddOutputFilterByType DEFLATE application/x-javascript + BrowserMatch ^Mozilla/4 gzip-only-text/html + BrowserMatch ^Mozilla/4\.0[678] no-gzip + BrowserMatch \bMSIE !no-gzip !gzip-only-text/html + Header append Vary User-Agent + RewriteEngine On + AddEncoding gzip .gz + RewriteCond %{HTTP:Accept-encoding} gzip + RewriteCond %{REQUEST_FILENAME}.gz -f + RewriteRule ^(.*)$ $1.gz [QSA,L] -- libgit2 0.21.4