首页 > 代码库 > apache 网站gzip压缩失败

apache 网站gzip压缩失败

 

iis 开始gzip模块,只需要在iis安装gzip.dll,启动就可以,查看响应报头,Content-Encoding成功返回:gzip,说明gzip模块开启成功;

技术分享

 

apache 网站gzip压缩

网站www.qiuxue365.cn,服务器windows server;web server :apache/2.4.23  在apache开启gzip,开启失败;求指点

配置如下:

  LoadModule headers_module modules/mod_headers.so

  LoadModule deflate_module modules/mod_deflate.so

  LoadModule filter_module modules/mod_filter.so

 

  <IfModule mod_deflate.c>

  DeflateCompressionLevel 6

  SetOutputFilter DEFLATE

  AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/x-javascript application/javascript application/json

  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

  AddOutputFilterByType DEFLATE text/*

  AddOutputFilterByType DEFLATE application/ms* application/vnd* application/postscript application/javascript application/x-javascript AddOutputFilterByType DEFLATE application/x-httpd-php application/x-httpd-fastphp

  BrowserMatch ^Mozilla/4 gzip-only-text/html

  BrowserMatch ^Mozilla/4.0[678] no-gzip

  BrowserMatch \bMSIE !no-gzip !gzip-only-text/html

  </IfModule>

技术分享

 

apache 网站gzip压缩失败