I develop part of an ASP.NET site that uses mostly themes but has a couple of CSS files in the themes folder. These are included in the web.config by another developer like
The issue here (from my experiences in similar problems) is the Content-Length
.
Check if you set the Content-Length
in any part of your code, remove it and it will work again. Why is that ? because if you set the Content-Length
on header the IIS then fail to change it to the compressed one, and the decompress of the gzip fails. Why IIS fail to change it ? because by default if you set a header on IIS this header remain and can not be change (especially if you flush it early). There is a flag that let IIS change it after you set it but its better just to avoid to set it.
Similar questions: ASP.NET site sometimes freezing up and/or showing odd text at top of the page while loading, on load balanced servers
From the @thinkOfaNumber : It turns out I was using devexpress compression as well as IIS compression. I turned off devexpress compression in the web.config and it works!
What is show here is that the first compression set the Content-Length
and the second compression fail to change it because Content-Length
is write on header and header can not change* after you have set it, so the second compression change the final compressed side with result that the browser fail to read it correct, and then fail to decompress it correct.
[*] There is a way to change the headers after you have send them on IIS, and before send them to the browser, and this can be done with changing the default behavior of IIS but is not so easy and I do not know if can solve this issue.