Brotli Pre-compression for Only One Account
Hi Guys...
I'd like to enable Brotli pre-compression for just one of my accounts who will actually be taking the time to manually Brotli compress their static assets. In reference to this thread: Where the compression is restricted to a particular directory to also limit the pre-compression to just one account? Something like:
If so, is tag recursive? Will this directive apply to any and all content in the public_html directory and/or any of its subdirectories? Thanks, Alec
# Serve brotli compressed CSS and JS files if they exist
# and the client accepts brotli.
RewriteCond "%{HTTP:Accept-encoding}" "br"
RewriteCond "%{REQUEST_FILENAME}\.br" "-s"
RewriteRule "^(.*)\.(js|css)" "$1\.$2\.br" [QSA]
# Serve correct content types, and prevent double compression.
RewriteRule "\.css\.br$" "-" [T=text/css,E=no-brotli:1]
RewriteRule "\.js\.br$" "-" [T=text/javascript,E=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
If so, is tag recursive? Will this directive apply to any and all content in the public_html directory and/or any of its subdirectories? Thanks, Alec
Please sign in to leave a comment.
Comments
0 comments