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 so:
<Content Include="App_Themes\SoftOrange\CMSStyles.css" />
<Content Include="App_Themes\SoftOrange\ContentStyles.css" />
On our internal test server (IIS7, Server 2008 R2 Enterprise) the global IIS manager options for static and dynamic compression are on, for files larger than 2700 bytes. The site-specific static and dynamic compression are also enabled.
At some point (probably when CMSStyles.css hit 2700 bytes) some styles got stuffed - ie. were obviously not loading by looking at the page. I found that the content-type (according to firefox 7.0.1) was showing text/css, and when I loaded the URL for CMSStyles.css it looked like normal compressed junk in a text editor:
‹�����etc. IE doesn't directly open the css file, but when I use developer tools to show the css, it appears empty.
I turned off static content compression just for this site, and the CSS files now load properly. My question is why?! Is it a content-type problem, Content-Encoding, or is this an IIS problem, or a problem with the way the CSS is used in the web app?
thanks.
EDIT:
These are the headers for the GET request for CMSStyles.css: Response Headers
Accept-Ranges bytes Content-Encoding gzip Content-Length 1728 Content-Type text/css Date Fri, 13 Apr 2012 01:22:43 GMT Etag "80a762a82cecd1:0" Last-Modified Fri, 30 Mar 2012 04:22:03 GMT Persistent-Auth true Server Microsoft-IIS/7.5 Vary Accept-Encoding X-Powered-By ASP.NET
Request Headers
Accept text/css,*/*;q=0.1 Accept-Charset ISO-8859-1,utf-8;q=0.7,*;q=0.7 Accept-Encoding gzip, deflate Accept-Language en-gb,en;q=0.5 Connection keep-alive Cookie -removed- Host -removed- Referer -removed- User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:7.0.1) Gecko/20100101 Firefox/7.0.1
so it looks like the content-encoding is corrent: gzip.