Skip to content

How to Enable JSON Gzip Compression in Apache

Covers
Apache, deflate, mod_deflate
Advertisement

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

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

Leave a Reply

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


Back to top