I had an issue on a server running IIS 8 not consistently compressing my .js, .css and other files. It turned out the issue had something to do with the CPU load.
To this issue the solution was to open the applicationHost.config file (C:WindowsSystem32inetsrvconfig – remember to backup this file!). Remeber to open this in a 64 bit text editor like notepad.
In the <httpCompression directory="%SystemDrive%inetpubtempIIS Temporary Compressed Files"> section I added staticCompressionDisableCpuUsage="100" staticCompressionEnableCpuUsage="100"
This tells the server to not disable the compression of static assets.