How to enable GZIP/HTTP compression on your site/wordpress

Not sure how I got it into my head today. Shower thought I guess. I wanted to see if I could compress my wordpress sites to see if I could get them to load faster. Gzip is the way.

Why GZIP? It can compress and save at least 50% and up to 80% of bandwidth. So if you have bandwidth limits on your hosting site it would be a good idea to enable it. ( I have unlimited bandwidth at namecheap)

Will my visitors notice that I am using GZIP? The compressing and unzipping only takes a fraction of a second and the end user will not notice. Most sites today are using GZIP.

I have a lot of photos on my site will GZIP help me? GZIP compression is not recommended for non-text files, such as graphical files and .zip files because it hardly saves space and can therefore increase the loading time.

 

How easy is it to setup? Super easy! All you have to do is edit your .htaccess file. and add a module and BOOM!

 

<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.msfontobject
AddOutputFilterByType DEFLATE application/xfont
AddOutputFilterByType DEFLATE application/xfontopentype
AddOutputFilterByType DEFLATE application/xfontotf
AddOutputFilterByType DEFLATE application/xfonttruetype
AddOutputFilterByType DEFLATE application/xfontttf
AddOutputFilterByType DEFLATE application/xjavascript
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/xicon
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/javascript
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/xml
After you add the above test it out! http://www.whatsmyip.org/http-compression-test/

I reduced mine by 79.6%

For more information about setting up Gzip on your site check this guys article. He has a bit more detail.
https://torquemag.io/2016/04/enable-gzip-compression-wordpress/

Be the first to comment

Leave a Reply