I'm 302 redirecting requests for .axd files to be pulled from IIS server. Apache headers are properly showing 'Location' but the default 'Content-Type: text/html'. I have to change it to 'application/x-javascript' or 'application/javascript'. Redirection, however, takes about 2 seconds during which time some browsers continue to parse content as if they expect 'text/html' media type. Parsing would be done differently and more smoothly if browser knows 'application/javascript' type should be expected. I hope you get the idea.
I've tried using:
mod_mime
AddType application/javascript .axd
mod_headers
<FilesMatch "\.axd$">
Header set Content-Type "application/javascript"
</FilesMatch>
mod_rewrite [T] flag
[L,R=302,T=application/javascript] // it's Apache 1.3
Nothing works. Content-Type server header still is 'text/html'. What else should I try?
I'm about to give up and apply rewrite to process.php page where redirect and header change takes place by:
header("Location: http://www.example.com/");
header('Content-Type: application/javascript');
But this option would add at least a second to the load time.