GZIP is not working properly

In Hummingbird it says 'Gzip is not working properly'. I checked with our hosting provider who has said that gzip is enabled as default

  • Adam Czajczyk

    Hello Ashley

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

    I can see that Hummingbird is returning and error message along the information that GZIP compression is not enabled. A quick check with checkgzipcompression.com service seems to confirm that compression is enabled but I'm afraid it's not that simple.

    The aforementioned service only checks the homepage and it takes first HTTP header response which indeed returns gzip compression enabled message. However, that's just a simple test.

    I have examined your site's responses and I think you will want to talk to your host again, after all. Let me explain :slight_smile:

    The message in Hummingbird covers three "types of content": HTML, JavaScript and CSS. Those are different MIME types and it looks like not all of these mime types are in fact gzipped.

    For example, the homepage returns "gzip" content encoding HTTP headers, which is fine, but only for "application/javascript" MIME type. The "JavaScript" reported in Hummingbird requires also "text/javascript" MIME type to be enabled.

    In fact, these are all the MIME types that Hummingbird attempts to enable via .htaccess:

    "application/atom+xml"
    "application/javascript"
    "application/json"
    "application/ld+json"
    "application/manifest+json"
    "application/rdf+xml"
    "application/rss+xml"
    "application/schema+json"
    "application/vnd.geo+json"
    "application/vnd.ms-fontobject"
    "application/x-font-ttf"
    "application/x-font-opentype"
    "application/x-font-truetype"
    "application/x-javascript"
    "application/x-web-app-manifest+json"
    "application/xhtml+xml"
    "application/xml"
    "font/eot"
    "font/opentype"
    "font/otf"
    "image/bmp"
    "image/svg+xml"
    "image/vnd.microsoft.icon"
    "image/x-icon"
    "text/cache-manifest"
    "text/css"
    "text/html"
    "text/javascript"
    "text/plain"
    "text/vcard"
    "text/vnd.rim.location.xloc"
    "text/vtt"
    "text/x-component"
    "text/x-cross-domain-policy"
    "text/xml"

    Not necessarily all of them "must" be used on site and actually not all of them are. But it looks like some "crucial" ones are not enabled (or are allowed but cannot be enabled via .htaccess) and that's causing:

    - Hummingbird not being able to detect whether compression is enabled or not
    - site not actually being fully gzip compressed; it is compressed but only some assets

    Please get in touch with your host again and ask them if:

    1) the server is configured in a way that allows enabling/disabling GZIP compression for certain mime types via .htaccess?

    2) if at least following MIME types are allowed and enabled for compression on server:

    "application/javascript" (that one actually is, so you can skip it)
    "application/x-javascript"
    "text/css"
    "text/html"
    "text/javascript"
    "text/plain"

    Kind regards,
    Adam

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.