Re: brotli with Apache and PHP-FPM - possible?

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

 



[...]
> 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"):

Sounds like you need to enforce the correct order of the filters. I don't know
how to do that using "AddOutputFilterByType", but with "FilterProvider",
the example below should work. While you're there, you can also enable
mod_buffer to improve the compression ratio:

BufferSize 131072
FilterProvider buffer           BUFFER   "resp('Transfer-Encoding') ==
'' && %{CONTENT_TYPE} =~ m|^text/|"
FilterProvider gzip_compression DEFLATE  "resp('Transfer-Encoding') ==
'' && %{CONTENT_TYPE} =~ m|^text/|"
FilterProvider brotli_compression BROTLI_COMPRESS
"resp('Transfer-Encoding') == '' && %{CONTENT_TYPE} =~ m|^text/|"

FilterChain buffer brotli_compression gzip_compression


rainer

---------------------------------------------------------------------
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