views:

17

answers:

1

The answer to gzipping javascript files is always some variant of "let the server do it", but what if I want to locate javascript files at URIs that are not behind my web server? How can I store gzipped files and ensure browsers will correctly render the javascript? Do I need to add some header data at the beginning of the file itself for the major browsers to correctly use the file? And how can I accomplish that, since the file is binary? I tried encoding as base 64, but could not get that to work either. (My experiments were with the js URI behind my IIS 7 server.)

A: 

You can't. You need to set the Content-Encoding header.

Matthew Flaschen
...well, may not be possible, that's what I'm trying to find out.
Jack