<IfModule !LiteSpeed>
	<IfModule mod_headers.c>
		<IfModule mod_rewrite.c>
			RewriteEngine On

			RewriteCond %{HTTP:Accept-encoding} br
			RewriteCond "%{REQUEST_FILENAME}.br" -s
			RewriteRule "^(.+\.js)$" "%{REQUEST_URI}.br" [L,T=application/javascript,QSA]

			RewriteCond %{HTTP:Accept-encoding} gzip
			RewriteCond "%{REQUEST_FILENAME}.gz" -s
			RewriteRule "^(.+\.js)$" "%{REQUEST_URI}.gz" [L,T=application/javascript,QSA]

			RewriteCond %{HTTP:Accept-encoding} br
			RewriteCond "%{REQUEST_FILENAME}.br" -s
			RewriteRule "^(.+\.css)$" "%{REQUEST_URI}.br" [L,T=text/css,QSA]

			RewriteCond %{HTTP:Accept-encoding} gzip
			RewriteCond "%{REQUEST_FILENAME}.gz" -s
			RewriteRule "^(.+\.css)$" "%{REQUEST_URI}.gz" [L,T=text/css,QSA]

			<FilesMatch "\.(js|css)\.br$">
				SetEnv no-gzip 1
				SetEnv no-brotli 1
				# Serve correct encoding type.
				Header append Content-Encoding br
				# Force proxies to cache brotli &
				# non-brotli css/js files separately.
				Header append Vary Accept-Encoding
			</FilesMatch>

			<FilesMatch "\.(js|css)\.gz$">
				SetEnv no-gzip 1
				SetEnv no-brotli 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
			</FilesMatch>

			<FilesMatch "\.js\.(br|gz)$">
				Header set Content-Type "application/javascript; charset=utf-8"
				ForceType application/javascript
			</FilesMatch>
			<FilesMatch "\.css\.(br|gz)$">
				Header set Content-Type "text/css; charset=utf-8"
				ForceType text/css
			</FilesMatch>
		</IfModule>
	</IfModule>
</IfModule>
