• Resolved irumsohale

    (@irumsohale)


    I am on HTTP2 and using brotli compression in htaccess with below code. How can i compress (brotli compression) to concatenated / optimized JS and CSS by your plugin?
    Am i doing something wrong here ?

    <IfModule mod_headers.c>
    # Serve brotli compressed CSS files if they exist and the client accepts brotli.
    RewriteCond %{HTTP:Accept-encoding} br
    RewriteCond %{REQUEST_FILENAME}\.br -s
    RewriteRule ^(.*)\.css $1\.css\.br [QSA]

    # 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 brotli compressed JS files if they exist and the client accepts brotli.
    RewriteCond %{HTTP:Accept-encoding} br
    RewriteCond %{REQUEST_FILENAME}\.br -s
    RewriteRule ^(.*)\.js $1\.js\.br [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]
    RewriteRule \.css\.br$ – [T=text/css,E=no-gzip:1]
    RewriteRule \.js\.br$ – [T=text/javascript,E=no-gzip:1]

    <FilesMatch “(\.js\.gz|\.css\.gz)$”>
    # Serve correct encoding type.
    Header set Content-Encoding gzip
    # Force proxies to cache gzipped & non-gzipped css/js files separately.
    Header append Vary Accept-Encoding
    </FilesMatch>
    <FilesMatch “(\.js\.br|\.css\.br)$”>
    # Serve correct encoding type.
    Header set Content-Encoding br
    # Force proxies to cache gzipped & non-gzipped css/js files separately.
    Header append Vary Accept-Encoding
    </FilesMatch>
    </IfModule>

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘How can i handle brotli compression on concatenated JS and CSS by your plugin?’ is closed to new replies.