• Resolved cyquer

    (@cyquer)


    I have activated W3TC on several WP systems and on all of them the well-known problem with gzip appears. Which update will fix it?

    While investigating the bug I noticed a stupid thing in the W3TC nginx.conf:

    set $w3tc_enc "";
    if ($http_accept_encoding ~ br) {
        set $w3tc_enc _br;
    }
    set $w3tc_enc "";
    if ($http_accept_encoding ~ gzip) {
        set $w3tc_enc _gzip;
    }

    How can br still activate itself with this code?

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

    (@vmarko)

    Hello @cyquer

    Thank you for your inquiry and I am happy to assist you with this.
    Can you please share the “well-known problem with gzip”?
    As for Br, you need to install PHP brotli extension https://github.com/kjdev/php-ext-brotli.
    You need that extension to compress pages for the page cache. We only check for that extension to let you enable the feature because there are multiple apache/nginx extensions that require different ways to check for availability.
    Thank you!

    Thread Starter cyquer

    (@cyquer)

    The known problem is that Edge and Safari do not work with W3TC and gzip. On Edge, strange Unicode is spit out and Safari indicates that the raw data cannot be decoded.

    I have installed Brotli, but I mean that the automatically generated nginx.conf does not work.
    First the variable w3tc_enc is set to “”, then it checks if br is supported. If it is supported _br is used.
    Then w3tc_enc is set to “” again which simply overwrites the previous check and finally it checks for gzip.
    How can it work as br?

    Plugin Contributor Marko Vasiljevic

    (@vmarko)

    Hello @cyquer

    Yes, it’s a known issue with Safari but the problem is on their end.

    It depends on which check-box is selected in Perforamance>Browser Cache. It’s not recommended to use both br and gzip so if you want to use br you should uncheck gzip box and vice versa.
    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Decode Error & Encoding override’ is closed to new replies.