Should you have GZIP compression enabled?
- What does it do?
- Why is it recommended?
- And are there any drawbacks?
GZIP is magical for me. You should definitely enable it if you want faster page loads. It’s a no-brainer and easy to enable. (I also go over the wrong way to do it!)
How to enable GZIP compression on your server/website?
- If you have cPanel, go to “Optimize Website” and choose “Compress All Content”.
- That’s it! Enjoy faster speeds!
- If you don’t have cPanel, please follow your control panel instructions, look up guides online, or ask your webhost/sys-admin.
Fine fine, need more info? I recommend GZIP on level 6. That’s the typical default and recommended by most folks. Going lower isn’t worth it and going higher is too slow.
Doesn’t GZIP slow down your server?
I’ve heard this claim before and it needs to be addressed.
- The answer is YES and NO.
For best practices, GZIP absolutely should be on all the time. It should not affect your page load at all…if anything, you should notice things being FASTER (not slower). Even better is if you can have Brotli enabled server-wide as well (I like LEVEL 4).
It’s true, GZIP does eat up some server resources (cpu processing during compression) and for that reason, many webhosts don’t have it enabled or at least not automatically—how sneaky! They prefer you to run out of bandwidth so they can charge you for overage. It’s a win-win for them.
But with that said. GZIP compression is only processed for the very first visit. After that, only compressed version is served (kinda like on-the-fly caching). As for the guy who thinks it slows down his server…it’s possible if your server is weak as heck.
Also too, there’s a trade-off in processing time vs downloading time. GZIP can compress 100KB of data down to 20KB. So you have to consider what’s faster….the time it takes to compress or the time it takes to download 80KB? On super fast connection, you might just say fine, skip compression and download full size. But on mobile connection, you will always always prefer compressing first and send less data.
Anyway, just my 2 cents.
- Check if your site is GZIP compressed – https://checkgzipcompression.com/
- Want better compression than GZIP? (Go with Brotli; I like compression level 4.)