ASP.NET MVC compression options in IIS6

前端 未结 3 2118
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-29 16:04

For now I\'m stuck with IIS6 for ASP.NET-MVC (as in I cant upgrade to Server 2008 yet). It doesnt seem to know that my RESTful URLS are dynamic files and isn\'t compressing

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-29 16:45

    Here's one option that seems to be working for me with MVC and IIS 6 using wildcard mappings and extensionless urls:

    1. set dynamic and static compression globally using the admin tool
    2. edit the metabase.xml so that HcScriptFileExtensions is blank in the CompressionSchemes. This will try to compress everything (including jpgs and gifs).
    3. Turn off dynamic compression at the folder level using the DoDynamicCompression = "false" property. This assumes all your static content is one directory.
    4. Add the static file extensions you do want compressed (css, js, etc) in the HcFileExtensions property.

    This is a workaround, but I'm stuck with Server 2003 and IIS 6 for the moment.

提交回复
热议问题