Gzipped javascript won't work on Firefox on Ubuntu/Centos

335 views Asked by At

strange issue... I have JS file gzipped by grunt-contrib-compress with following settings:

options: {
    mode: 'gzip',
    level: 1
}

And this file works fine on Windows on every browser, on iOS, Android but... doesn't work on Firefox on Ubuntu and Centos. I have error: Illegal character, which means, that Firefox can't handle gzipped JS. I downloaded response from the server, unpacked it and there is my file, looks fine. Moreover it works well on Chrome on Ubuntu.

I have no idea, what's wrong? Compression level doesn't change anything.

I can't change anything on the server, but I think configuration is Ok, it is something strange with file or Firefox or OS.

Headers:

Request:

Host: xxxx
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Firefox/38.0
Accept: */*
Accept-Language: pl,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate
Referer: xxx
Connection: keep-alive
If-Modified-Since: Mon, 15 Feb 2016 09:34:40 GMT
Cache-Control: max-age=0

Response:

Connection: keep-alive
Date: Mon, 15 Feb 2016 10:05:59 GMT
Last-Modified: Mon, 15 Feb 2016 09:34:40 GMT
Via: bi_cache71
X-Cache: HIT
X-Varnish: 2429245376
1

There are 1 answers

1
kzg On

it was extension...

When filename was myJS.js.gz I had errors, but I have changed filename to myJS.gz.js and apparently Firefox (and other browsers, like Internet on Android) now see this file as JS! :) Previously my file was recognized as an archive.