I’ve gziped my JavaScript file using gzip and uploaded it to Amazon S3. I’ve set the following:
content-type: application/x-javascript
content-encoding: gzip
The file was given public permissions.
The problem that when I refer the script to the location (correct one, I’ve checked) of the gzipped file (with js.gzip at the end), the application doesn’t run it. When I tried to view the file in Chrome browser, it tried to download the file instead of showing it.
What I’m doing wrong?
According to one answer of a similar question, there’s a bug in Safari (probably Webkit) which stops proper gzip acceptance with the “wrong” file extension.
File extension shouldn’t matter, but apparently Webkit screws it up. try either
.jgzor.gz.js.