text/xml
can be a problem. Some caching proxies will rewrite the character encoding of text/*
files. In the case of an XML file, this could make the actual character encoding differ from the character encoding declared within the document itself. And besides, I think text/xml
has been deprecated.
http://hsivonen.iki.fi/producing-xml/#textxml
So always use application/xml
for generic XML documents, and application/*+xml
for specific documents which have their own registered MIME types (application/xul+xml
for XUL, for example).
The only correct media type for javascript is application/javascript
(or application/ecmascript
, which is more strictly defined).
http://www.rfc-editor.org/rfc/rfc4329.txt
That said, many browsers won't care if you serve javascript as text/plain
or even make something up altogether.