CentOS 7 Apache 2.4开启Gzip压缩配置
确认以下模块配置未禁用
# vi /etc/httpd/conf.modules.d/00-base.conf
LoadModule deflate_module modules/mod_deflate.so
LoadModule headers_module modules/mod_headers.so
LoadModule filter_module modules/mod_filter.so
增加以下配置文件(文件类型或文件扩展名)
# vi /etc/httpd/conf.d/gzip.conf
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript
DeflateCompressionLevel 9
或
# vi /etc/httpd/conf.d/gzip.conf
SetOutputFilter DEFLATE