• Resolved mykkal

    (@mykkal)


    Hey guys, i’m trying to enable the brotli compression support included within w3tc but even after installing it on the server I’m unable to check it. Anyone that can point me in the right direction? Searching the forums I see a lot of different suggestions for getting it working with no clear consensus.

    I’m using php 7.3 on Centos 7

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @mykkal

    We check for the PHP function brotli_compress because that function is used to compress cache files and store a compressed version of the cache, the same as we do for gzip compression. If we would not do this, the server has to dynamically compress files when requested, which takes some time. That would defeat the purpose of using compression to speed up the website.
    This means that you need to install a PHP module Brotli so that Brotli can be enabled in W3 Total Cache

    1) install brotli
    apt-get install brotli

    test if installed:
    $ brotli –version
    brotli 1.0.7

    2) install PHP extension
    https://github.com/kjdev/php-ext-brotli

    $ cd /tmp
    $ git clone –recursive –depth=1 https://github.com/kjdev/php-ext-brotli.git
    $ cd php-ext-brotli
    $ phpize
    $ ./configure
    $ make
    $ make install

    reload apache and test if installed (in case of PHP 7.4):
    $ phpquery -v 7.4 -s apache2 -m brotli
    brotli (Enabled for apache2 by local administrator)

    3) go to WP admin -> W3TC -> Browser cache -> checkbox “Enable HTTP (brotli) compression” is now available (there are 3 checkboxes, check them all)

    4) reset W3TC page cache

    5) test with brotli checker
    https://tools.keycdn.com/brotli-test

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Brotli Compression Installed But Not Available In W3TC’ is closed to new replies.