brotli with Apache and PHP-FPM - possible?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I've tried enabling brotli with Apache on Ubuntu 20.04 (running Apache 2.4.41). Brotli works, but not for content generated with PHP.

It works for HTML files:

$ curl -v -H "Accept-Encoding: gzip, deflate, br" https://server.tld/pp.html 2>&1 | grep content-encoding
< content-encoding: br

But does not work if it's PHP - in this case, the content is compressed with "gzip":

$ curl -v -H "Accept-Encoding: gzip, deflate, br" https://server.tld/pp.php 2>&1 | grep content-encoding
< content-encoding: gzip

Curiously, it does work with PHP if I specify "br" as the only value in "Accept-Encoding" (browsers however use "gzip, deflate, br"):

$ curl -v -H "Accept-Encoding: br" https://server.tld/pp.php 2>&1 | grep content-encoding
< content-encoding: br

So, what is the problem here?


I've enabled brotli by running:

a2enmod brotli

and adding the following part to the vhost (followed by apache restart):

AddOutputFilterByType BROTLI_COMPRESS text/html text/plain text/xml text/css text/javascript application/x-javascript application/javascript application/json application/x-font-ttf application/vnd.ms-fontobject image/x-icon


Tomasz Chmielewski

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx




[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux