GZIP only works for text/html

Hi,

I’ve tried to enable GZIP on my page. However, it’s only working for html. CSS and javascript aren’t compressed.
mod_deflate is enabled. I’ve granted you support access.
Please also find attached the current htaccess file.

A note, which might be helpful: Compression for text/html also hadn’t work first. Only after I’ve set caching in the plugin WP Super Cache on mod_rewrite, compression for html worked.

Would be great, if you could have a look on it

    Nithin

    Hi Jonas,

    Hope you are doing good today.

    Thank you for sharing your .htaccess file, I'm not able to detect anything odd in your .htaccess file. Since, I don't see you mention about performing a plugin conflict test, could you please run a quick plugin/theme conflict test as illustrated in getting support manual (flowchart), and rule out any plugins that cause any conflicts.
    http://premium.wpmudev.org/manuals/using-wpmu-dev/getting-support/

    If you aren't able to notice any difference, could you please send us your credentials so that we can have a closer look?

    You can send credentials by using our secure contact form: http://premium.wpmudev.org/contact/

    Select “I have a different question” for your topic.

    - To Mark to my attention, the subject line should contain only: ATTN: Nithin Ramdas
    -WordPress admin username
    -WordPress admin password
    -login url
    -FTP credentials (host/username/password)
    -link back to this thread for reference
    -any other relevant urls

    Have a nice weekend.

    Kind Regards,
    Nithin

    Nithin

    Hi Jonas,

    Hope you are doing good today.

    I have gone through your website, and checked extensively, and did ask the developer to give a look regarding this. This seems like you are using Apache v2.2, instead of the latest version v2.4. Since the version 2.2 is more of a legacy version, and the mod_deflate module needs DEFLATE filter in order for the Gzip compression to work.

    I have created a /mu-plugins folder inside /wp-content folder, and have added a file hb-gzip.php with the following code:

    <?php
    add_filter( 'wphb_code_snippet', function( $code, $server, $module ) {
        if ( 'gzip' === $module->get_slug() && 'apache' === $server ) {
            return 'SetOutputFilter DEFLATE';
        }
    
        return $code;
    }, 10, 3 );

    This have fixed the issue, as the above code defines DEFLATE filter for GZip to work. You can now, enable, and disable Gzip through the Hummingbird plugin page.

    I hope this helps. Please let us know if you still need any further assistance. Have a nice day.

    Kind Regrads,
    Nithin