Enable compression for css and js files

#1
How can enable compression for css and js files on litespeed Gzip configuration?
My current "Compressible Types" is:
text/*, application/x-javascript, application/xml, application/javascript
 
#2
How can enable compression for css and js files on litespeed Gzip configuration?
My current "Compressible Types" is:
text/*, application/x-javascript, application/xml, application/javascript
Here's what I use you might find useful:

Code:
##### serve pre gziped files #####

  <IfModule mod_headers.c>
    Header set Connection keep-alive
    # Rules to correctly serve gzip compressed CSS and JS files.
    # Requires both mod_rewrite and mod_headers to be enabled.
    # 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 [L,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 [L,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]

    <FilesMatch "(\.js\.gz|\.css\.gz)$">
      # 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
    </FilesMatch>

    <FilesMatch "\.(htm|html|php)$">
      <IfModule mod_headers.c>
        BrowserMatch MSIE ie
        Header set X-UA-Compatible "IE=Edge,chrome=1" env=ie
      </IfModule>
    </FilesMatch>
  </IfModule>
      
###########################################
 

NiteWave

Administrator
#3
How can enable compression for css and js files on litespeed Gzip configuration?
My current "Compressible Types" is:
text/*, application/x-javascript, application/xml, application/javascript
this already enough to enable gzip css and js.
css is text/css, included in "text/*",
js is application/javascript or application/x-javascript, already included as well.
 
Top