IIS 8.5 Dynamic Compression Issue 4


Windows Server 2012 R2 comes with IIS 8.5, and in this release an issue has been found in relation to the Dynamic Compression module.  The module sets the “Vary” header which is used to specify caching properties that the browser uses to determine whether the response should be cached or not. 

In IIS 8.0 and earlier, the Dynamic Compression module was overwriting the Vary header with the value “Accept-Encoding”, and as it happens this is the correct value to ensure that dynamic content is correctly cached – but – according to IIS it should be appending this value to the existing value and not overwriting it.

As it happens, this was supposed to be fixed in IIS 8.5 but the fix appears to be broken.   In IIS 8.5 (which ships with Windows Server 2012 R2) the Vary header is being set to “*” and the “Accept-Encoding” from the Dynamic Compression module is not appended.  The result of this is that no dynamic content is being cached by the browser.

Workaround

Thankfully there is an easy workaround in IIS 8.5 for this:

1. Select an IIS site, and go to Configuration Editor.

image

2. Select system.web/caching/outputCache section, then set the omitVaryStar property to true

image

image

Setting this value results in the Vary header being returned with a value of “Accept-Encoding” and the browser then caches the dynamic content.


About Rob Sanders

IT Professional and TOGAF 9 certified architect with nearly two decades of industry experience, 18 years in commercial software development and 11 years in IT consulting. Check out the "About Rob" page for more information.


Leave a comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

4 thoughts on “IIS 8.5 Dynamic Compression Issue

  • Vishal Shah

    Hi Sanders,

    I am using the same configuration (Windows Server 2012 R2 + IIS 8.5 (which ships with Windows Server 2012 R2) & without doing the above settings (i.e. omitVaryStar is False), I am still getting Vary header with the value “Accept-Encoding” & I can see the compression works with Fiddler.

    So I am not really sure, in which condition I need to configure the setting which you have mentioned? Or I misunderstood anything.

    Best Regards,
    Vishal