Skip to content

How to Enable JSON Gzip Compression in Apache

Covers
Apache, tar

First of all, make sure Apache deflate module is enabled on your system. The below command will enable the deflate module for in Apache on Debian based systems. This tutorial has been tested on Ubuntu 18.04.

sudo a2enmod deflate

Then edit the module configuration file in your favorite text editor.

sudo vim /etc/apache2/mods-enabled/deflate.conf

Then add “AddOutputFilterByType DEFLATE application/json” in the deflate module configuration file.

Save your file and restart Apache2 service to apply new settings.

systemctl restart apache2.service

All done.

Rahul

Rahul Kumar is the founder and chief editor of TecAdmin.net. A Red Hat Certified Engineer (RHCE), he has worked in IT since 2009, with hands-on experience in Linux system administration, DevOps, web hosting, cloud platforms and automation. He started TecAdmin in 2013 to share practical, step-by-step guides, and leads its editorial work with one aim: making technical learning clear and useful for sysadmins, developers and beginners alike.

Leave a Reply

Your email address will not be published. Required fields are marked *


Back to top