gzip is not working properly, our server may not have the "deflate" module enabled

I'm getting this error while trying to enable compression:

gzip is not working properly:
- Your server may not have the "deflate" module enabled (mod_deflate for Apache, ngx_http_gzip_module for NGINX)
- Another plugin may be interfering with the configuration
If re-checking and restarting does not resolve, please check with your host or open a support ticket with us.

Please point me in the right direction. Thanks

  • Milan
    • WordPress Wizard

    Hello Robert

    Hope you are well today and thanks for asking us. :slight_smile:

    This clear states that your server has not enable deflate module for your site. :slight_smile: Its kind of process which requires installation of deflate module libs so its better that you contact your hosting provider and tell them to enable deflate module for your site. :slight_smile:

    Let me know what they says on this. :slight_smile:
    Cheers,
    Milan

  • Rupok
    • Support Ninja

    Hi Robert

    Hope you had a wonderful day.

    It means most likely your server is not configured to support .gzip compression. There may be some other reasons but this is most likely. I'd suggest contacting your host first and asking them to confirm whether the "mod_deflate" (if it's Apache) or "ngx_https_gzipm_module" (if it's NGINX) is enabled and configured on your server.

    If it's not, please ask them if they could enable it for you. Hopefully they will and this should solve the issue. In case they confirmed that it's already enabled, would you mind allowing Support Access so we can have a closer look at this?

    To enable support access you can follow this guide here:
    https://premium.wpmudev.org/manuals/wpmu-dev-dashboard-enabling-staff-login/

    Have a nice day. Cheers!

  • Chamosan
    • Flash Drive

    Thanks for your replies. My hosting company confirmed that mod_deflate is enabled and working properly. Below is the code in the .htaccess file:

    # BEGIN WP-HUMMINGBIRD-GZIP
    <IfModule mod_deflate.c>
    # Compress HTML, CSS, JavaScript, Text, XML and fonts
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
    AddOutputFilterByType DEFLATE application/x-font
    AddOutputFilterByType DEFLATE application/x-font-opentype
    AddOutputFilterByType DEFLATE application/x-font-otf
    AddOutputFilterByType DEFLATE application/x-font-truetype
    AddOutputFilterByType DEFLATE application/x-font-ttf
    AddOutputFilterByType DEFLATE application/x-javascript
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE font/opentype
    AddOutputFilterByType DEFLATE font/otf
    AddOutputFilterByType DEFLATE font/ttf
    AddOutputFilterByType DEFLATE image/svg+xml
    AddOutputFilterByType DEFLATE image/x-icon
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/javascript
    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/xml

    # Remove browser bugs (only needed for really old browsers)
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    Header append Vary User-Agent
    </IfModule>
    # END WP-HUMMINGBIRD-GZIP

    The error I'm getting in the admin site is:

    - Your server may not have the "deflate" module enabled (mod_deflate for Apache, ngx_http_gzip_module for NGINX)

    BUT I'm not using NGINX, instead I use apache. Could this be the issue?

  • Milan
    • WordPress Wizard

    Hello Robert

    Hope you are well today and thanks for getting back to us. :slight_smile:

    So finally we have information that your server has deflate module enabled. Great. :slight_smile: Now in this process of confirmation, you granted support staff access has been expired. So you'll need to regrant it one more time. :slight_smile:

    Furthermore at this point of troubleshooting, plugin conflict test would be better if there are some plugins which modifies your site's htaccess file. So please take down if so by following flowchart stated in our this support manual. :slight_smile:
    https://premium.wpmudev.org/manuals/using-wpmu-dev/getting-support/

    Please let me know how it goes. :slight_smile:
    Cheers,
    Milan

  • Chamosan
    • Flash Drive

    Thank you guys for your help... I solved the issue by adding the following to my .htaccess

    <ifModule mod_deflate.c>
    <FilesMatch "\.(css|js|x?html?|php)$">
    SetOutputFilter DEFLATE
    </FilesMatch>
    </ifModule>

    Apparently, compression is only enabled for "text/html" content. I'm asking the hosting company to double check this.

  • Bill
    • Somewhere in Between

    Chamosan

    Thanks a bunch, it worked for me as well. Which Apache mod are you using on the server?

    Just a note, everything was working fine until I made a change to Apache.

    This problem came up when I added a Moodle install to the server and it required some addition PHP modules. To get those modules installed I had to change Apache from prefork to worker.

    So the problem came in with the way worker handles the compression versus how prefork handled it. I added the code you provided and all is well.

  • Bill
    • Somewhere in Between

    Chamosan and everyone else.

    WPMUDEV Support made a suggestion to check a setting in the php.ini file. They said to make sure
    zlib.output_compression = On

    I checked and mine was set to off in the default PHP7.7 php.ini file. I changed it to on and removed the lines from .htaccess. Gzip for html is now active.

    You can see the post here: https://premium.wpmudev.org/forums/topic/html-gzip-compression-is-not-working-but-deflate-module-is-enabled-on-the-server

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.