1. in httpd. add the following content to the site configuration in conf: AddOutputFilterByTypeDEFLATEtext/htmltext/plaintext/csstext/xmltext/javascriptDeflateCompressionLevel9SetOutputFilterDEFLATE2. in. htac 1. in httpd. add the following content
Locate the following two lines in the Apache configuration file, and then remove the comment # and reboot.
The code is as follows
Copy Code
LoadModule Deflate_module modules/mod_deflate.soLoadModule Expires_module
First of all, we first understand the relevant information of Apache Gzip.
First, Gzip introduction
Gzip is a popular file compression algorithm, now widely used, especially in the Linux platform. When you apply gzip compression to a plain text
One: Apache related concurrency control
Mainly prefork and worker two one to control. We can use HTTPD-L to determine whether the MPM currently in use is PREFORK.C or WORKER.C.
# httpd-lCompiled in Modules:Core.cPrefork.cHttp_core.cMod_so.c
The
First scenario: Add in. htaccess
The code is as follows
Copy Code
AddHandler application/x-httpd-php. css. html. js#这是添加你要压缩的类型Php_value auto_prepend_file "/home/a4284418/public_html/gzip.php"
Enable the deflate_Module and headers_Module modules in httpd. conf.Remove the preceding two sentences:LoadModule deflate_module modules/mod_deflate.soLoadModule headers_module modules/mod_headers.soAdd the following code at the bottom of the httpd.
[Author: Zhang banquet this article version: V1.0 last modified: 2007.09.10 reprint please indicate the source: http://blog.s135.com]
1. If Apache is not installed. During compilation, add -- enable-Deflate. For example: (for Linux only, this step
Given the limited bandwidth on the internet, any effort by network administrators to speed up access is valuable. One of the methods is to accelerate the access speed through HTTP compression technology. It reduces the amount of data transmitted
This article introduces how to enable gzip in centos apache. If you need it, refer to it.
The method for enabling gzip compression is simple. Connect to the server and open the configuration file "httpd. conf". Find the following two sentences and
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.