Bug 9521 - Safari fails to load Gzip compressed JavaScript or CSS
: Safari fails to load Gzip compressed JavaScript or CSS
Status: RESOLVED INVALID
: WebKit
WebCore Misc.
: 420+
: Macintosh Mac OS X 10.4
: P4 Normal
Assigned To:
: http://pdatabase.dyndns.biz/baldness....
: InRadar
:
:
  Show dependency treegraph
 
Reported: 2006-06-20 23:20 PST by
Modified: 2008-05-26 13:12 PST (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2006-06-20 23:20:12 PST
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 From 2006-06-21 02:04:25 PST -------
The network layer doesn't ask for x-gzip, but the server still sends it:

Accept-Encoding: gzip, deflate
------- Comment #2 From 2006-06-21 02:31:38 PST -------
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 From 2007-08-16 15:30:30 PST -------
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 From 2007-08-16 21:47:41 PST -------
(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 From 2007-08-16 23:18:15 PST -------
Does this technique work in Firefox 2.0.0.x?  Opera 9.2x?  MSIE 6/7?
------- Comment #6 From 2007-08-17 08:10:56 PST -------
(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 From 2007-08-17 08:16:41 PST -------
(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 From 2007-08-17 08:45:43 PST -------
<rdar://problem/5418646>
------- Comment #9 From 2007-09-04 11:15:05 PST -------
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 From 2007-09-04 11:37:11 PST -------
Marking bug RESOLVED/INVALID since this is not a WebKit bug.

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