How to disable gzip compression for flv files in IIS 7 with runAllManagedModulesForAllRequests set to true?

I have an ASP.NET 3.5 website running on IIS 7, and I would like to have static content (e.g. css files, javascript files, etc.), gzip compressed, as well as my dynamic content (.net- pages). The problem is that I need to make sure that the FLV files (flash video files) are not compressed by gzip, because it causes problems with the used flash video player, Flowplayer .

I added the following line to my web.config, which allows compression, but then my FLV files are also gzip compressed:

<urlCompression doStaticCompression="true" doDynamicCompression="true" /> 

I tried adding the following to my web.config but didn't change anything:

 <httpCompression> <staticTypes> <remove mimeType="video/x-flv"/> </staticTypes> <dynamicTypes> <remove mimeType="video/x-flv"/> </dynamicTypes> </httpCompression> 

I need to disable doDynamicCompression for flv files that will not be compressed by gzip. I believe that it treats FLV files as dynamic content, because I have runAllManagedModulesForAllRequests = "true" in my web.config (which I need for some of the things I do with routing).

In general, how to disable gzip compression for FLV files?

+4
source share
1 answer

I think it’s best to manually control what gzip'd gets. Sometimes that gzip'd can actually grow in size, like swf, is what I came across. I used to have application.config this block, and after I deleted the tick of the sim type, swf stopped the compression

 <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> 

This is in my application configuration in windows\system32\intersrv\config\application.config , but I'm sure you can do it on the website in your web.config under the system.webserver section.

All I had to do for me was to remove the tick type of the shock wave and it stopped compressing, but there were all other valid mime types.

+1
source

Source: https://habr.com/ru/post/1335251/


All Articles