Enable Apache gzip in Centos

Source: Internet
Author: User
Why do I need to enable Gzip? A: After Gzip is enabled, the data output to the user's browser will be compressed to reduce the amount of data transmitted over the network and increase the browsing speed. How to enable Gzip? 1. first find httpd. the conf file is applicable to Linux servers. generally, it is in the apache/conf Directory. 2. enable the gzip function and load related modules. The gzip function uses the mod_deflate.so module. The first step is to introduce mod.

Why do I need to enable Gzip?

A: After Gzip is enabled, the data output to the user's browser will be compressed to reduce the amount of data transmitted over the network and increase the browsing speed.

 

How to enable Gzip?

1. first find the httpd. conf file

For Linux servers

2. enable the gzip function and load related modules:

 

The gzip function uses the mod_deflate.so module. The first step is to introduce the mod_deflate.so module:

First open the httpd. conf file, search for the mod_deflate.so line, and then remove the "#" comment symbol before the line.

 

LoadModule deflate_module modules/mod_deflate.so

3. configure gzip. Gzip files are common web files, such as js and css.

Add the following at the end of the configuration file:

 

DeflateCompressionLevel 6

AddOutputFilter DEFLATE html xml js css jpg gif png

 

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.