Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»General Articles»How to Enable JSON Gzip Compression in Apache

    How to Enable JSON Gzip Compression in Apache

    By RahulJune 12, 20191 Min Read

    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.

    Advertisement
    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.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    <IfModule mod_deflate.c>
       <IfModule mod_filter.c>
           AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css
           AddOutputFilterByType DEFLATE application/x-javascript application/javascript application/ecmascript
           AddOutputFilterByType DEFLATE application/rss+xml
           AddOutputFilterByType DEFLATE application/xml
           AddOutputFilterByType DEFLATE application/json
       </IfModule>
    </IfModule>

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

    systemctl restart apache2.service
    

    All done.

    Apache deflate mod_deflate
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    How to Split Large Archives in Linux using the Command Line

    System.out.println() Method in Java: A Beginner’s Guide

    sleep Command in Linux with Examples

    Add A Comment

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • How to Split Large Archives in Linux using the Command Line
    • System.out.println() Method in Java: A Beginner’s Guide
    • Split Command in Linux With Examples (Split Large Files)
    • Test Your Internet Speed from the Linux Terminal
    • 11 Practical Example of cat Command in Linux
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.