Enable brotli and disabling deflate

sahostking

Well-Known Member
May 15, 2012
366
8
68
Cape Town, South Africa
cPanel Access Level
Root Administrator
Twitter
We've been using deflate and have an include where it enables gzip with deflate globally for all sites on all our servers.

Should we remove this include from per-virtualhost as brotli is being used be default now - will it not cause duplicate compression if we leave the deflate(gzip) include in include editor still?

Thanks for advice.
 

sahostking

Well-Known Member
May 15, 2012
366
8
68
Cape Town, South Africa
cPanel Access Level
Root Administrator
Twitter
I enabled brotli via Easyapache and tested it. I get on brotli test sites that it is support and headers how that to with "br"

However if I use a tool like gtmetrix it gives me a rating of [0] saying compression is not enabled. Does this not mean I should leave deflate on aswell? I'm thinking brotli only works for SSL requests only.
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,252
313
Houston
Per their blog gtmetrix does not see brotli compression: Recommendations Update

They're only recognizing gzip compressed pages, brotli works on both http/https sites you'd just need to be utilizing a tool that recongnizes it.

Brotli Test, Brotli Compression Test | IPVoid may be an option

You can use a curl request to check brotli is working, such as the following:

Code:
curl -I -H 'Accept-Encoding: br' http://domain.com
 

sahostking

Well-Known Member
May 15, 2012
366
8
68
Cape Town, South Africa
cPanel Access Level
Root Administrator
Twitter
I tested it on a site using PHP7.3 seems its not available on that version yet? I know its integrated in Apache but on PHP there is also an extension that is required. So I guess its not yet available for PHP 7.3.11?

curl -I -H 'Accept-Encoding: br' https://sitename

HTTP/2 301
date: Tue, 19 Nov 2019 17:40:49 GMT
server: Apache
x-powered-by: PHP/7.3.11
expires: Thu, 19 Nov 1981 08:52:00 GMT
cache-control: no-store, no-cache, must-revalidate
pragma: no-cache
x-redirect-by: WordPress
set-cookie: PHPSESSID=075937b4147da9c6cc2c3f85e07f7d4e; path=/
set-cookie: ywsl_wp_session=dfb184aa47d287461f92b55784ce9cc0%7C%7C1574228450%7C%7C1574226650; expires=Wed, 20-Nov-2019 05:40:50 GMT; Max-Age=43200; path=/
location: https://sitename
vary: User-Agent
content-type: text/html; charset=UTF-8