Bug 9521 - Safari fails to load Gzip compressed JavaScript or CSS
Summary: Safari fails to load Gzip compressed JavaScript or CSS
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P4 Normal
Assignee: Nobody
URL: http://pdatabase.dyndns.biz/baldness....
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2006-06-20 23:20 PDT by Eric Seidel (no email)
Modified: 2017-10-27 10:13 PDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2006-06-20 23:20:12 PDT
http://pdatabase.dyndns.biz/baldness.js.gz

$ curl -I http://pdatabase.dyndns.biz/baldness.js.gz
HTTP/1.1 200 OK
Date: Wed, 21 Jun 2006 06:12:38 GMT
Server: Apache/1.3.34 (Unix) PHP/4.3.10
Last-Modified: Thu, 25 May 2006 21:21:18 GMT
ETag: "4e4645-cf2a-44761fce"
Accept-Ranges: bytes
Content-Length: 53034
Content-Type: application/x-javascript
Content-Encoding: x-gzip

It looks to be sent correctly.  But Safari fails to load it.

It's used by:

http://pdatabase.dyndns.biz/test16.php
Comment 1 Alexey Proskuryakov 2006-06-21 02:04:25 PDT
The network layer doesn't ask for x-gzip, but the server still sends it:

Accept-Encoding: gzip, deflate
Comment 2 Alexey Proskuryakov 2006-06-21 02:31:38 PDT
Strange, the previous comment didn't get through in its entirety :-O

...So, I think this is a server bug, and also probably a CFNetwork limitation.
Comment 3 Kirk Cerny 2007-08-16 15:30:30 PDT
Safari will not load my javascript or my css when it is gziped.
The headers are correct, the file name seems to be the issue.

If the file has a .gz extension it will not be rendered.
If I use the apache module mod_gzip the css gets gzipped but it does not add the .gz extension, and safari renders the css.

The headers in both cases are exactly the same except for the file name.

Content-Type text/css 
Content-Encoding gzip


Comment 4 Alexey Proskuryakov 2007-08-16 21:47:41 PDT
(In reply to comment #3)
> Safari will not load my javascript or my css when it is gziped.

Could you please provide an URL to a test case?
Comment 5 David Kilzer (:ddkilzer) 2007-08-16 23:18:15 PDT
Does this technique work in Firefox 2.0.0.x?  Opera 9.2x?  MSIE 6/7?

Comment 6 Kirk Cerny 2007-08-17 08:10:56 PDT
(In reply to comment #5)
> Does this technique work in Firefox 2.0.0.x?  Opera 9.2x?  MSIE 6/7?
> 

Yes, the .gz extension works in Firefox 2.0.0.x  Opera 9.2x  MSIE 6/7

Comment 7 Kirk Cerny 2007-08-17 08:16:41 PDT
(In reply to comment #4)
> (In reply to comment #3)
> > Safari will not load my javascript or my css when it is gziped.
> 
> Could you please provide an URL to a test case?
> 

http://kirk.galaxytechsolutions.com
Comment 8 David Kilzer (:ddkilzer) 2007-08-17 08:45:43 PDT
<rdar://problem/5418646>
Comment 9 Joost P. Vermeer 2007-09-04 11:15:05 PDT
Quote of HTTP spec:

RFC 2616 - Hypertext Transfer Protocol
3.5 Content Codings

        Use of program names for the identification of encoding formats
        is not desirable and is discouraged for future encodings. Their
        use here is representative of historical practice, not good
        design. For compatibility with previous implementations of HTTP,
        applications SHOULD consider "x-gzip" and "x-compress" to be
        equivalent to "gzip" and "compress" respectively.

Comment 10 David Kilzer (:ddkilzer) 2007-09-04 11:37:11 PDT
Marking bug RESOLVED/INVALID since this is not a WebKit bug.

The issue will be tracked internally through the Radar bug.  Thanks!