启用GZIP压缩错误:STATIC_COMPRESSION_NOT_SUCCESS [英] Enable GZIP Compression error: STATIC_COMPRESSION_NOT_SUCCESS
本文介绍了启用GZIP压缩错误:STATIC_COMPRESSION_NOT_SUCCESS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试在IIS 7.5上启用GZIP压缩。
I'm trying to enable GZIP compression on IIS 7.5.
我认为所有设置都可以。
I think all the settings are okay.
在ApplicationHost.config中有这个httpCompression部分:
In ApplicationHost.config I have this httpCompression section:
<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files" minFileSizeForComp="0">
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />
<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" />
</staticTypes>
</httpCompression>
此urlCompression部分:
And this urlCompression section:
<urlCompression dostaticcompression="true" />
这是失败的请求跟踪结果:
and Here is Failed Request Tracing result:
STATIC_COMPRESSION_NOT_SUCCESS
Reason="UNKNOWN_ERROR"
推荐答案
如果我看一下 html5-boilerplate 项目的web.config,他们使用这种方法:
If I look at web.config of the html5-boilerplate project they use this method:
<!--
GZip static file content. Overrides the server default which only compresses static files over 2700 bytes
-->
<httpCompression directory="%SystemDrive%\websites\_compressed" minFileSizeForComp="1024">
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />
<staticTypes>
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/javascript" enabled="true" />
<add mimeType="application/json" enabled="true" />
<add mimeType="*/*" enabled="false" />
</staticTypes>
</httpCompression>
https://github.com/paulirish/html5-boilerplate-server-configs/blob/master/web.config
也许是您指定的零值或您使用的目录路径。
Perhaps it's the zero value you have specified, or the directory path you are using.
另请参阅
- How can I get gzip compression in IIS7 working?
这篇关于启用GZIP压缩错误:STATIC_COMPRESSION_NOT_SUCCESS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文