Forum Moderators: open

Message Too Old, No Replies

How to use web compression in browsers

Pre-compressed Javascript file to be referred in browser

         

prem_India

1:37 pm on Mar 17, 2006 (gmt 0)

10+ Year Member



I have a pre-compressed javascript file and this file is referred in my html file.

When the browser queries for the javascript file (foo.js), my web-server (apache) searches for that file and returns with the pre-compressed file (foo.js.gz) to the browser. But the browser is not properly compressing it. It shows like invalid characters in the javascript console.

Can anyone help me here, please?

Thanks in Advance,
Prem

prem_India

1:49 pm on Mar 17, 2006 (gmt 0)

10+ Year Member



Please read the text "But the browser is not properly compressing it" in my post as follows:
"But the browser is not properly uncompressing it".

kaled

3:54 pm on Mar 17, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Which browser?

Have you tested it with several and found one fails or have you only tested with one and found it fails (Internet Explorer?)

If you've only tried one browser, I suggest you try a couple more (Opera, Firefox). If they all fail, then the problem would seem to be the server.

Kaled.

prem_India

9:17 am on Mar 18, 2006 (gmt 0)

10+ Year Member



Thanks Kaled!

I tried in multiple browsers and PCs and it does not seem to work.

If itz the problem with the server, what should I do in the server? Any settings need to me modified?

-/Prem

kaled

12:12 pm on Mar 18, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I can't help with servers, however, you should check that it is compressed correctly. I presume you can decompress the file by some means without relying on a browser.

Depending on what characters are being scrambled, it might be a code-page issue but I don't know how you might fix it.

You might also verify that MIME type is set correctly using an http header checker such as [rexswain.com...]

Kaled.