I had the same problem since months with Firefox on Linux (i.e. across reboots and cache clearing but on only one of two similarly installed machines). The site looked like bare html (without any styles applied) and things such as voting buttons did not work.
Short answer: In my case the the problem was that the Firefox parameter
network.http.accept-encoding
(in about:config
) was set to the
empty string. Resetting it to its default value
gzip, deflate
makes Stackoverflow work again.
Longer answer:
I saw the problem even with -safe-mode (i.e. with all extensions disabled). Looking at the error console, Firefox complains about an 'illegal character' in the data of http://cdn.sstatic.net/js/stub.js?v=f3ba9bf843c1 . This seems to be a gzipped javascript file (downloaded it by hand and ran file
on it) and for some reason Firefox seems to interpret it without unzipping it. Then there are consecutive javascript errors about unknown symbols (which are defined in this gzipped javascript file).
Looking at the HTTP traffic, one sees (with my original, problematic setting):
Request:
GET /js/stub.js?v=f3ba9bf843c1 HTTP/1.1
Host: cdn.sstatic.net
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20100101 Firefox/5.0
Accept: */*
Accept-Language: en-us,en;q=0.5
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
Referer: http://stackoverflow.com/
Note that there is no field Accept-Encoding
indicating that Firefox is ready to accept gzipped data.
HTTP response to this:
HTTP/1.1 200 OK
Server: nginx/0.8.36
Date: Sat, 25 Jun 2011 16:53:21 GMT
Content-Type: application/x-javascript
Connection: keep-alive
Cache-Control: max-age=604800
Content-Encoding: gzip
Last-Modified: Fri, 24 Jun 2011 13:33:57 GMT
ETag: "64cd5e5e7332cc1:0"
Vary: Accept-Encoding
Content-Length: 6464
X-Cache: HIT
Accept-Ranges: bytes
so the nginx server responds with a Content-Encoding
field set to gzip
, ignoring the clients capabilities. I'm not sure but this looks to me like a violation on the server side.
After setting the Firefox parameter network.http.accept-encoding
to its factory setting value, the http communication for the above javascript file looks as follows:
Request:
GET /js/stub.js?v=f3ba9bf843c1 HTTP/1.1
Host: cdn.sstatic.net
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:5.0) Gecko/20100101 Firefox/5.0
Accept: */*
Accept-Language: en-us,en;q=0.5
Accept-Encoding: gzip, deflate
Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
Connection: keep-alive
Referer: http://stackoverflow.com/
Now Firefox tells the server it accepts gzipped data.
Response:
HTTP/1.1 200 OK
Server: nginx/0.8.36
Date: Sat, 25 Jun 2011 17:02:08 GMT
Content-Type: application/x-javascript
Connection: keep-alive
Cache-Control: max-age=604800
Content-Encoding: gzip
Last-Modified: Fri, 24 Jun 2011 13:33:57 GMT
ETag: "64cd5e5e7332cc1:0"
Vary: Accept-Encoding
Content-Length: 6464
X-Cache: HIT
Accept-Ranges: bytes
-safe-mode
(i.e. without any extensions). Looking at the error console, Firefox complains about an 'illegal character' in the file downloaded from cdn.sstatic.net/js/stub.js?v=f3ba9bf843c1 . This seems to be a gzipped javascript file and for some reason firefox seems to interpret it without unzipping it.