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.
2. Select system.web/caching/outputCache section, then set the omitVaryStar property to true
Setting this value results in the Vary header being returned with a value of “Accept-Encoding” and the browser then caches the dynamic content.
4 thoughts on “IIS 8.5 Dynamic Compression Issue”
Thanks alot for sharing this, I had a hard time figuring out why compression wasnt working on IIS8.5
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
Hi Vishal,
It might have been patched by now. I’ll see if I can verify..
R
Thanks Anders… Looking forward to hear your analysis…Just to make sure that I am not missing any setting on our server.