• Resolved stefanoste

    (@stefanoste)


    Hi

    I’m trying to enable the brotli compression for the static files (css, js) but I can’t figure out how to do it, I have checked under /s directory and I only see .js .css and .css.gz .js.gz files.
    In the plugin Advanced config page I see:
    >Enable text compression (ON)
    Gzip Compression (ON)
    Gzip Compression in .htaccess (OFF)
    Reorder Attributes (ON)

    Brotli is not mentioned anywhere.

    My server is a ubuntu 22, nginx/1.25.3 with brotli support, PHP-FPM 8.1, The PHP module php-ext-brotli is installed and activated, (PHP can produce .br files, I have checked with another WP plugin)

    Thank you for your help

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Denis Ryabov

    (@dryabov)

    Hmm, Brotli compression works well on our test server with “Enable text compression” and “Gzip Compression” enabled. Note that enabling “Gzip Compression” is sufficient to use the best compression algorithm supported by the visitor’s browser (Gzip, Deflate or Brotli), so the Brotli is not mentioned in the interface, but you can check that the server’s response contains the Content-Encoding: br header.

    • This reply was modified 10 months, 4 weeks ago by Denis Ryabov.
    Thread Starter stefanoste

    (@stefanoste)

    Denis thanks for the quick response!
    unfortunately I confirm that the files optimized by the plugin (served from the /s directory) have the header: Content-Encoding: gzip
    Also in the /s directory I only see two files per kind, i.e:
    /s/fa3ade.js
    /s/fa3ade.js.gz
    The nginx server can talk brotli in fact I have tried to compress a .js file by hand with the commandline and thus, nginx starts to use it as response, confirmed by the Content-Encoding: br header

    Plugin Author Denis Ryabov

    (@dryabov)

    Currently, PageSpeed Ninja compresses HTML code using Brotli, but in the next release (1.2.0), optimized JS and CSS files will also be precompressed using Brotli.

    Thread Starter stefanoste

    (@stefanoste)

    thank you very much!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘How to enable Brotli compression?’ is closed to new replies.