Gzip compression – How to turn it on

Apache Gzip Compression
0 0 votes
Article Rating

Continuing with providing tips for website performance results — or just making sure we’re no longer getting a failing grade via performance reports from GTMetrix, Google’s PageSpeed Insights, or web.dev — here’s how to enable gzip compression on your Apache server.

First, check if mod_deflate is installed and enabled. It should be installed and enabled since mod_deflate is a default module enabled out the box for Apache. Run apachectl -t -D DUMP_MODULES | grep deflate and look for

deflate_module (shared)

Then add this to your .htaccess file.

Then add this to your Apache conf file /etc/apache2/apache2.conf

And finally restart your Apache server sudo service apache2 restart

I hope that helps! Oh, and make sure you check out my post on how to leverage browser caching.

0 0 votes
Article Rating

If you found this post useful ...

Buy Me a Coffee logo
Wondering why you keep seeing lower-cased 'i' in my posts? Read -> Why ‘i’ is not capitalized
Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

1 Comment
Oldest Most Voted
Inline Feedbacks
View all comments
February 3, 2019 11:54 am

[…] Be sure to check out the two sister posts on leveraging browser caching and gzip compression. […]

Would love your thoughts, please comment.x