GZIP Compression

I wrote a ticket to my hosting providers because gzip compression from hummingbird was not able to start/compress HTML. I am using the latest Wordpress Version with theme Impreza.

Since the compression of js and pics etc. I am not able to use background pictures with WP Bakery Page Builder! It only works when is switch in the admin panel "show this page not minified" -> then the bgpictures appears again.

They sent me an email wich said: I have to put a line of code in my htaccess file:

<IfModule mod_deflate.c>
<filesMatch "\.(js|css|html|php)$">
SetOutputFilter DEFLATE
</filesMatch>
</IfModule>

Still it is not working, my current .htaccess file looks like this:

## WP Defender - Prevent information disclosure ##
<FilesMatch "\.(txt|md|exe|sh|bak|inc|pot|po|mo|log|sql)$">
Order allow,deny
Deny from all
</FilesMatch>
<Files robots.txt>
Allow from all
</Files>
<Files ads.txt>
Allow from all
</Files>
## WP Defender - End ##
# BEGIN WP-HUMMINGBIRD-CACHING

<IfModule mod_deflate.c>
<filesMatch "\.(js|css|html|php)$">
SetOutputFilter DEFLATE
</filesMatch>
</IfModule>

<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault A0

<FilesMatch "\.(txt|xml|js)$">
ExpiresDefault A691200
</FilesMatch>

<FilesMatch "\.(css)$">
ExpiresDefault A691200
</FilesMatch>

<FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav|mp4|m4v|ogg|webm|aac|eot|ttf|otf|woff|svg)$">
ExpiresDefault A691200
</FilesMatch>

<FilesMatch "\.(jpg|jpeg|png|gif|swf|webp)$">
ExpiresDefault A691200
</FilesMatch>
</IfModule>

<IfModule mod_headers.c>
<FilesMatch "\.(txt|xml|js)$">
Header set Cache-Control "max-age=691200"
</FilesMatch>

<FilesMatch "\.(css)$">
Header set Cache-Control "max-age=691200"
</FilesMatch>

<FilesMatch "\.(flv|ico|pdf|avi|mov|ppt|doc|mp3|wmv|wav|mp4|m4v|ogg|webm|aac|eot|ttf|otf|woff|svg)$">
Header set Cache-Control "max-age=691200"
</FilesMatch>

<FilesMatch "\.(jpg|jpeg|png|gif|swf|webp)$">
Header set Cache-Control "max-age=691200"
</FilesMatch>
</IfModule>
# END WP-HUMMINGBIRD-CACHING
# BEGIN WP-HUMMINGBIRD-GZIP

<IfModule mod_deflate.c>
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
</IfModule>
</IfModule>
<IfModule mod_filter.c>
AddOutputFilterByType DEFLATE "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"

</IfModule>
<IfModule mod_mime.c>
AddEncoding gzip svgz
</IfModule>

</IfModule>
# END WP-HUMMINGBIRD-GZIP

Maybe you got an solution for me? Did I something wrong?

Thanks

  • Dimitris
    • Support Star

    Hello there Petro,

    hope you're doing good today! You did nothing wrong here, no worries! :slight_smile:

    Could you please try to remove the

    <IfModule mod_deflate.c>
    <filesMatch "\.(js|css|html|php)$">
    SetOutputFilter DEFLATE
    </filesMatch>
    </IfModule>

    and insert it at the very end of the file? After the
    # END WP-HUMMINGBIRD-GZIP

    If that doesn't make any difference (you should go in GZIP admin page and re-check status), please remove both custom snippet and HummingBird's GZIP snippet and insert manually the one found here: https://wordpress.org/support/topic/gzip-5/#post-9971904

    Let us know how that goes! :slight_smile:

    As for the page builder issue, this is happening most probably due to the Minification module of HummingBird, so you should try to remove from compression all assets (CSS and JS files) coming from the WP Bakery Page Builder, save changes and check again.
    If you find troubles finding the source of that, we could have a look. Just grant us with support access as shown here
    https://premium.wpmudev.org/docs/getting-started/getting-support/#chapter-5
    and let us know here in your next reply that you did so, as we don't get any notifications about it.

    Warm regards,
    Dimitris

  • Petro
    • New Recruit

    Hey Dimitris,
    i am doing good...hope you too!? :wink:

    first of all - thank you for your help! Community at its best!

    So about the gzip issue - I tried it both ways you told me, but in any case it is still not possible to get the gzip compression for html running. JS and CCS is working...kind a strange huh?

    About the page builder issue I don't even have an idea where to look at :smiley:

    Greets from Austria

    Petro

  • Dimitris
    • Support Star

    Hello Petro,

    doing good, thanks for asking! Hope the same for you too! :slight_smile:

    So about the gzip issue - I tried it both ways you told me, but in any case it is still not possible to get the gzip compression for html running. JS and CCS is working...kind a strange huh?

    Could you please contact your hosting provider to ensure that GZIP compression isn't deactivated for HTML files?
    If not, then please proceed with a conflict test, meaning:
    - grab a recent backup of whole website (files and database)
    - deactivate all other plugins apart from WPMUDEV Dashboard and HummingBird
    - activate a default theme like TwnetySeventeen
    - re-check GZIP status
    If this is resolved, then there's some conflict, so activate the remaining plugins and theme, one by one this time, checking each time GZIP status until you reproduce the error once more.
    https://premium.wpmudev.org/wp-content/uploads/2015/09/Support-Process-Support-Process.gif

    About the page builder issue I don't even have an idea where to look at

    In next link you can find HummingBird's Minification documentation:
    https://premium.wpmudev.org/docs/wpmu-dev-plugins/hummingbird/#chapter-4
    which should shed some more light in my previous reply.
    If you find troubles finding the source of that, we could have a look. Just grant us with support access as shown here
    https://premium.wpmudev.org/docs/getting-started/getting-support/#chapter-5
    and let us know here in your next reply that you did so, as we don't get any notifications about it.

    Warm regards,
    Dimitris

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.