帮助中心

如何为linux系统云主机配置gzip(deflate)模块?

2012/12/10 10:58:51

需要在apache配置文件(默认路径/var/www/conf/httpd.conf)加入以下配置:

DeflateCompressionLevel 9
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-httpd-php
AddOutputFilter DEFLATE js css

然后重启apache
# /var/www/bin/apachectl restart
重启完毕即可生效。