Solution at last
After several hours of googling and trying various unsuccessful solutions I finally found the answer! Buried in the comments of a post on Rick Strahl’s blog, Imad Jureidini had pointed out the following:
I’ve been running into the same issues. Ultimately, the solution was to change the following config setting:
The default value here is “2”, which means that even static content does not get compressed if it isn’t requested twice within a 10 seconds period (frequentHitTimePeriod). Switching to “1” means that the file gets compressed right away.
Hopefully this will fix your problems too 🙂
I then used the following command to change the setting in my servers config:
%windir%system32inetsrvappcmd.exe set config
This begs the question – why would Microsoft do such a thing? Surely the point of compression of static resources is to reduce delivery time to the browser. Why should my users care if anyone else has recently requested the particular resource they are interested in? They aren’t and shouldn’t be. These static resources should be compressed first, time everytime. (The only exception to this would be where compression is straining the servers ability to serve content).
Where is the documentation?
I’ve got to say my experiences with IIS 7 to date have been one frustration after the next. Microsoft appears to have put a lot of work into this product and at first glance a lot of the new features look to offer real value. What I don’t understand is why there is so little documentation on this new product. So much has changed from IIS 6 there really needs to be a comprehensive set of documentation available somewhere – if it does exist I have yet to find it…