Thursday, June 30, 2005

Technical Difficulties Destroy Profitability, Cause Deadline Over-runs

So I'm programming like a mad man yesterday. Everything is going well and looking sharp then suddenly my website on my development server does not look at all like the website on the production server. It will take nearly 5 hours of troubleshooting and 5 hours of sleep to figure out what happened.

The Problem: The CSS in Mozilla Firefox don't load on the development server but load fine on the production server. To confound the issue the style sheet works in IE on both servers. The problem is reproducible from multiple computers. If the style sheet is referenced by <link> as in <link rel="stylesheet" type="text/css" href="stylesheet.css"> it doesn't load. If it is referenced with a block it works fine.

The Solution: I found the solution in MozillaCssMimeType ()
some servers are misconfigured and return an incorrect MimeType for CSS files (typically text/plain or application/x-pointplus) which should be sent with a text/css MimeType

Adding "text/css          css" to apache's mime.types file (usually found in /etc/mime.types) solves the problem. For IIS simply map .css to text/css using:
site (or directory) properties, then HTTP Headers>File Types>New Type, .css, text/css.


Now to get to work. I feel two days behind.