one major purpose of
RewriteCond %{HTTP:Accept-encoding} gzip
RewriteCond %{REQUEST_FILENAME}\.gz -s
RewriteRule ^(.*)\.css $1\.css\.gz [QSA]
RewriteRule \.css\.gz$ - [T=text/css,E=no-gzip:1]
<FilesMatch "(\.js\.gz|\.css\.gz)$">
Header set Content-Encoding gzip
Header append Vary Accept-Encoding
</FilesMatch>
is:
when request
http://.../sites/default/files/css/test.css
if sites/default/files/css/test.css.gz exists, then web server send .../test.css.gz directly back to browser.
my test result:
when request
http://.../sites/default/files/css/test.css directly,
browser get "404 Not Found". that is to say, above rules under drupal root not work as expected, but put those rules in sites/default/files/css/.htaccess, will work as expected.
why those rules not work but page still display correctly, I think because of
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^ index.php [L]
i.e., pass to index.php to process.
as result, .css files are served as dynamic page(php), not static page.
we know static page are much efficient than dynamic page.
to verify, just remove above rules from drupal root/.htaccess, the site should still display correctly. then add to files/css/.htaccess, to archive the initial goal.
(I did tests on my minimal drupal installation and ok)
of course, the issue discussed in this thread "why work under apache but not under litespeed", not clear yet, but there is progress toward it.