Gzip is not working, but mod_deflate is enabled

I’m getting this error message in Hummingbird, but I checked with my host and they’ve confirmed that mod_deflate is installed on this server:

Gzip is not working properly:

- Your server may not have the "deflate" module enabled (mod_deflate for Apache, ngx_http_gzip_module for NGINX).
- Contact your host. If deflate is enabled, ask why all .htaccess or nginx.conf compression rules are not being applied.
If re-checking and restarting does not resolve, please check with your host or open a support ticket with us.

I’ve also checked that zlib output support is enabled on the server as well.

  • Adam Czajczyk

    Hello Dane

    I hope you're well today and thank you for your question!

    I have checked your site and I can see the message there. While the message is quite "generic" it's actually only pointing to one specific file MIME type, which is "text/html". That means that the required modules are enabled so that's not the issue here.

    It is possible, though, that the current configuration of mod_deflate might be too strict. On some servers, caching either cannot be configured via .htaccess at all (and it's simply enabled by default) or it can be switched on/off but not "fine tuned" or is available only for some specific MIME types.

    That said, could you please reach out to your host once again to make sure that following MIME types are actually allowed:

    "application/x-web-app-manifest+json"
    "application/xhtml+xml"
    "application/xml"
    "text/html"
    "text/plain"
    "text/xml"

    At least, last three of them :slight_smile:

    Let me know please.

    Kind regards,
    Adam

  • Dane

    Hi Adam,

    I contacted my hosting. This is what they said;

    We have added Gzip code and everything is enabled on our end. There is no issue on our end. You may have to check with plugin vendor on this issue.

    I have rechecked and it's still not working.

    Note: I still can't Minify JavaScript either? It says; Hummingbird found 0 files and has automatically optimized 0 of them! If you wish to have more control, switch to advanced mode.

  • Predrag Dubajic

    Hi Dane,

    Could you try adding these rules to your .htaccess file and see if HTML is showing as properly compressed after that:

    <IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/plain
    AddOutputFilterByType DEFLATE text/html
    AddOutputFilterByType DEFLATE text/xml
    AddOutputFilterByType DEFLATE text/css
    AddOutputFilterByType DEFLATE application/xml
    AddOutputFilterByType DEFLATE application/xhtml+xml
    AddOutputFilterByType DEFLATE application/rss+xml
    AddOutputFilterByType DEFLATE application/javascript
    AddOutputFilterByType DEFLATE application/x-javascript
    AddOutputFilter DEFLATE .shtml
    </IfModule>

    Note: I still can't Minify JavaScript either? It says; Hummingbird found 0 files and has automatically optimized 0 of them! If you wish to have more control, switch to advanced mode.

    I checked this on couple of my test installations but couldn't replicate it I'm afraid, could you try disabling your other plugins and switching to default WP theme to see if it will work after that?
    This should tell us if there's a conflict test with something on your installation and we can further debug it from there.

    Best regards,
    Predrag

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.