Search code examples
.netasp.netepiserver

IIS 6 Compress static files when using Wildcard application mapping


I'm using IIS 6 with EPiserver CMS which requires all requests to go through aspnet_isapi.dll.

I want to gzip all my static files (js, css mainly). Trying to setup compression in IIS didn't work.

Is there a setting in EPiServer that will allow me to achieve this? Can .net framework compress files automatically?


Solution

  • You'll need to configure the html extension in the IIS metabase as a dynamically compressed extension. You are probably treating it as a static page. If the .js and .css extensions are mapped to aspnet_isapi they are considered as dynamic pages.

    The setting in metabase.xml should look like this:

    HcScriptFileExtensions="asp
    dll 
    exe 
    js
    css"
    

    Don't forget to remove the extensions from HcFileExtensions (for static files) if you inserted them there before.

    Hope this helps.