相关疑难解决方法(0)

GZip压缩在IIS 7.5上无法正常工作

我试图支持IIS下的静态文件的GZip压缩(默认情况下应该启用但不能)但到目前为止还没有工作.这是<system.webServer>Web应用程序的web.config文件中节点下的部分;

<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
  <scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" staticCompressionLevel="9" />
  <dynamicTypes>
    <add mimeType="text/*" enabled="true" />
    <add mimeType="message/*" enabled="true" />
    <add mimeType="application/x-javascript" enabled="true" />
    <add mimeType="application/json" enabled="true" />
    <add mimeType="*/*" enabled="false" />
  </dynamicTypes>
  <staticTypes>
    <add mimeType="text/*" enabled="true" />
    <add mimeType="message/*" enabled="true" />
    <add mimeType="application/x-javascript" enabled="true" />
    <add mimeType="application/atom+xml" enabled="true" />
    <add mimeType="application/xaml+xml" enabled="true" />
    <add mimeType="*/*" enabled="false" />
  </staticTypes>
</httpCompression>

<urlCompression doStaticCompression="true" />
Run Code Online (Sandbox Code Playgroud)

我尝试使用谷歌浏览器.这是请求标题;

接受:text/html,application/xhtml + xml,application/xml; q = 0.9,/ ; q = 0.8

接收字符集:ISO-8859-1,utf-8; Q = …

.net asp.net iis gzip iis-7.5

57
推荐指数
4
解决办法
5万
查看次数

如何在IIS 7.5中启用GZIP压缩

我想使用GZIP压缩我的文件.你能分享使用GZIP压缩文件的web.config代码吗?

上传我的web.config文件后还有什么需要做的吗?

compression gzip web-config

32
推荐指数
4
解决办法
10万
查看次数

gzip压缩无法与IIS 8.5一起使用

我有一个运行IIS的Server 2012 R2盒子.我已经尝试为在该盒子上运行的几个站点启用压缩,但我无法弄清楚它为什么不起作用.我的请求标题都显示为accept-encoding,但响应标头始终为Transfer-Encoding:chunked和Vary:Accept-Encoding.已执行以下步骤以尝试使gzip压缩工作:

  1. 已在每个站点和计算机级别启用动态和静态压缩
  2. 两种压缩方法均从服务器管理器安装
  3. 已将httpcompression和urlcompression节点手动添加到web.configs
  4. Mime类型被定义用于压缩
  5. frequentHitThreshold已设置为1,因此所有内容应在首次尝试访问后进行压缩

已经进行了跟踪以了解为什么没有发生压缩.我唯一的信息是代码DYNAMIC_COMPRESSION_NOT_SUCCESS,原因是1.

以下是标题:

GET http://redactedservername:8082/ HTTP/1.1  
Host: redactedservername:8082  
Connection: keep-alive  
Cache-Control: max-age=0  
Accept:   text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8  
Upgrade-Insecure-Requests: 1  
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36  
DNT: 1  
Accept-Encoding: gzip, deflate, sdch  
Accept-Language: en-US,en;q=0.8  
Cookie: ASP.NET_SessionId=gnqovt55ggt22lycufudc0ns  
Run Code Online (Sandbox Code Playgroud)

`

HTTP/1.1 200 OK  
Cache-Control: private  
Content-Type: text/html; charset=utf-8  
Vary: Accept-Encoding  
Date: Wed, 22 Jun 2016 14:00:57 GMT  
Transfer-Encoding: chunked
Run Code Online (Sandbox Code Playgroud)

可以执行哪些其他步骤来使压缩工作?

iis gzip http-compression windows-server-2012-r2 iis-8.5

2
推荐指数
1
解决办法
4748
查看次数