raksmart活动促销

分享

写回答

发帖

Centos7开启Gzip压缩的方法

Raksmart Raksmart 7982 人阅读 | 1 人回复

发表于 2019-12-18 14:41:26 | 显示全部楼层 |阅读模式

网站需要开启Gzip,貌似centos7默认没有Gzip,请问怎么开启?

回答|共 1 个

wenbo2010

发表于 2019-12-20 14:45:58 | 显示全部楼层

找到配置文件httpd.conf,修改方法为在最后加上如下一段代码:

<ifmodule mod_deflate.c>
SetOutputFilter DEFLATE
SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI .(?:exe|t?gz|zip|bz2|sit|rar)$ no-gzip dont-vary
SetEnvIfNoCase Request_URI .(?:pdf|mov|avi|mp3|mp4|rm)$ no-gzip dont-vary
DeflateCompressionLevel 6
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/x-httpd-php
AddOutputFilter DEFLATE js css
</ifmodule>
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

RakSmart讨论

RakSmart
优惠码:6.5折优惠链接
介绍:RakSmart是知名的美国服务器租用商,包括美国站群服务器、美国cn2服务器、香港服务器等热门产品,RakSmart与国内中国联通、中国电信、中国移动三大线路直连,国内访问速度快。
查看更多

djptop

发表主题