OK geeks, help me out, for I am vexed.
FireFox 1 is out, and it’s great. In FireFox tradition, it’s very strict about web standards. I like that. But it also means that if a server sends a particular MIME type for a file, the browser handles it as such. Most browsers ignore the MIME type for .css files, and just handle them. But if FireFox hears from the server that a .css file has a type of text/plain rather than text/css, it will refuse to render it, and you’ll see the complaint in its console.
And suddenly, this site and others that we host are sometimes displaying without stylesheets when viewed through FireFox 1. To test whether the server is doing the right thing, I went to web-sniffer and enter the URL of a dirt-simple test: http://birdhouse.org/temp/styles.css. Look at the return for Content-Type — about half the time it returns text/css, half the time it returns text/plain (try toggling settings for GET vs. HEAD, etc.) WTF?
So just fix the MIME type for .css on the server, right? Right. In mime.types, we already have the default:
That should be sufficient, but obviously isn’t. For good measure, I added an explicit AddType to commonhttpd.conf:
AddType text/css .css
No change. For giggles, I add the same to an .htaccess in one of the affected directories. No change.
I’ve posted messages to the apache-users mailing list, to an apache config newsgroup, to the Mozilla forums, and to DevShed. No useful responses. Finally I decide to do something I’ve never done: Pay for Unix support. Found some recommendations on an apache guru-for-hire and just spent an hour on the phone with him. He studied our apache config up, down, and sideways, couldn’t find anything unusual, and certainly nothing that would cause MIME types to change intermittently.
The problem is not unheard of. Google for css firefox mime apache to find similar problems. Some people actually are missing the right MIME configuration, and are able to fix the problem by adding it. But we’re already configured properly.
Update: I just got around to testing an index.html file with the sniffer rather than .css, and found that it alternates between types of text/plain and text/html, just as css files alternate between text/plain and text/css. Something is definitely weird.
Flummoxed, and no fix in site. Fun way to spend veterans day. Suggestions welcome.