Skip to content

Can RequestReduce work with static pages?

mwrock edited this page Oct 14, 2011 · 2 revisions

RequestReduce will process css and javascripts in any page that has a content type of text/html. However, if you have static compression turned on in IIS 7 (and you should), the default static compression implementation employed by IIS may prevent RequestReduce processed files from being served on static extension types like html. If you would like to use RequestReduce to process css on .html, .htm, you will need to tell IIS that these extensions are dynamic in order to use IIS's dynamic compression algorithm which will work fine with RequestReduce. The static compression module employed by IIS, caches the compression after the first response. While this is efficient, if RequestReduce has not previously processed the css and scripts on the page, RequetReduce will not process the page until after the first request and by that time the static compression module has already cached the non RequestReduce procesed file.

Using the dynamic compression module instead of the static compression module should realy have a minimal impact on CPU even on a busy server. To do this, add this to your web.config:

<system.webServer>
    <handlers>
        <add name="html" path="*.html" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
    </handlers>
</system.webServer>

Your precondition attribute may differ on a 64 bit system and the path of the scriptProcessor attribute may differ depending on the location of the framework directory on your system.

Clone this wiki locally