问题描述
我有一个ASP.NET 3.5网站在IIS 7上运行,我想有我的静态内容(如CSS文件,JavaScript文件等)的gzip COM pressed以及我的动态内容(。净页)。问题是,我需要确保FLV文件(Flash视频文件)不是gzip压缩COM pressed因为引起的问题与我使用,的。
I have an ASP.NET 3.5 Website that is running on IIS 7 and I would like to have my static content (like css files, javascript files, etc) gzip compressed as well as my dynamic content (.net pages). The problem is that I need to make sure flv files (flash video files) are not gzip compressed because that causes problems with the flash video player I'm using, Flowplayer.
我添加下面一行到我的web.config这使得COM pression,但后来我的flv文件也正在gzip的COM pressed:
I've added the following line to my web.config which enables compression, but then my flv files are also being gzip compressed:
<urlCompression doStaticCompression="true" doDynamicCompression="true" />
我试过下面添加到我的web.config,但它并没有改变什么:
I've tried to add the following to my web.config, but it did not change anything:
<httpCompression>
<staticTypes>
<remove mimeType="video/x-flv"/>
</staticTypes>
<dynamicTypes>
<remove mimeType="video/x-flv"/>
</dynamicTypes>
</httpCompression>
我要关掉doDynamicCom pression的flv文件不被gzip的COM pressed。我认为这是对待FLV文件动态内容,因为我有我的web.config runAllManagedModulesForAllRequests =真(我需要一些东西,我用的路由做)。
I have to turn off doDynamicCompression for the flv files not to be gzip compressed. I think that it is treating flv files as dynamic content because I have runAllManagedModulesForAllRequests="true" in my web.config (which I need for some of the things I'm doing with routing).
总之,我如何禁用的gzip COM pression对于FLV文件?
In summary, how do I disable gzip compression for flv files?
推荐答案
我觉得做的最好的事情是手动管理什么是越来越gzip压缩。有时什么gzip压缩实际上可以扩大规模,像一个swf,这就是我刚才碰上了。 previously我的 application.config
有这个块吧,以后我删除了冲击波MIME类型SWF的停止COM pressing
I think the best thing to do is to manually manage what is getting gzip'd. Sometimes what is gzip'd can actually increase in size, like a swf, which is what I just ran into. Previously my application.config
had this block in it, and after I removed the shockwave mime type swf's stopped compressing
<httpCompression directory="%SystemDrive%\inetpub\temp\IIS Temporary Compressed Files">
<scheme name="gzip" dll="%Windir%\system32\inetsrv\gzip.dll" />
<dynamicTypes>
<clear />
<add mimeType="text/*" enabled="true" />
<add mimeType="message/*" enabled="true" />
<add mimeType="application/x-javascript" enabled="true" />
<add mimeType="application/x-amf" enabled="true" />
<add mimeType="application/json" enabled="true" />
<add mimeType="application/json; charset=utf-8" enabled="true" />
<add mimeType="application/x-shockwave-flash" enabled="true" /> <!-- notice the swf mime type -->
<add mimeType="*/*" enabled="false" />
</dynamicTypes>
<staticTypes>
<clear />
<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="application/x-shockwave-flash" enabled="true" /> <!-- notice the swf mime type -->
<add mimeType="*/*" enabled="false" />
</staticTypes>
</httpCompression>
这是在我的应用程序配置中 WINDOWS \\ SYSTEM32 \\ intersrv \\ CONFIG \\ application.config
但我pretty相信你可以在做每个网站您在 system.webserver
的Web.config。
This is in my application config in windows\system32\intersrv\config\application.config
but I am pretty sure you can do this per website in your web.config under system.webserver
.
我不得不为我做的是去除冲击波MIME类型和它停止越来越融为一体pressed但所有其他有效的MIME类型为。
All I had to do for me was to remove the shockwave mime type and it stopped getting compressed but all other valid mime types were.
这篇关于我如何禁用IIS 7中的FLV文件的gzip COM pression与runAllManagedModulesForAllRequests设置为true?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!