Forcing Apache server to send specific MIME type...

Forcing Apache server to send specific MIME type...

Post by Juan Mirand » Fri, 18 Jan 2002 06:56:03



Hi,

I'm wrestling with a problem (I'm not very knowledgeable in HTTP servers) trying
to get gzipped content decoded "on the fly" by the web browser. In theory, I
should be able to do this in my web page:

<script type="application:x-javascript" src="whatever.js.gz"></script>

and receive the gzipped file, at which point the browser unzips it.

However, this is not happening.

I know that in order for this to function, the server needs to send

"Content-Encoding:gzip"
"Content-Type:application/x-javascript".

However, using an HTTP tracer, I can see that the server is sending back the
headers:

"Content-Type:application/x-gzip"
"Content-Encoding:gzip".

Anybody knows why this is happening? How can I "force" the server to send the
correct content type?

Any light you can shed on this subject will be appreciated.

Juan Miranda

 
 
 

Forcing Apache server to send specific MIME type...

Post by Paul Rubi » Fri, 18 Jan 2002 07:49:49



> Anybody knows why this is happening? How can I "force" the server to send the
> correct content type?

Use mod-asis, or a non-parsed-header (nph) cgi script, etc.

 
 
 

Forcing Apache server to send specific MIME type...

Post by Chris Osbo » Fri, 18 Jan 2002 07:55:12




Quote:>and receive the gzipped file, at which point the browser unzips it.

If you're using IE, it won't work. IE will tell the server it can
handle gzipped content but it actually can't.

--
DON'T PAY MORE FOR WEB HOSTING THAN WHAT YOU WANT TO PAY
At Full System, Inc. you invent the package *and* the price!
Point your browser to http://custom.fullsystem.com/