Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MegaMan1311

macrumors regular
Original poster
Jun 30, 2007
216
0
USA
I just learned about the great compression called GZIP. I enabled it on my forums, and I have had no issues yet, but I tried to GZIP the javascript files on my site, and it didn't work. Safari doesn't like it very much.

I did some reading and found out that Safari doesn't support GZIP as of 2007. What about now with Safari 3? My site doesn't get hit much with Safari, excluding me, and the users who visit my site with safari keep it updated.

Thanks in advance!
MegaMan1311
 
I think you have to configure the webserver to send the appropriate info so the browser can decode Gzip'd content. If Safari didn't support it, you wouldn't be reading most of the modern internet at all.
 
Yeah, this is a misconfiguration on your end; the page you're looking at right now is being sent with gzip compression, and I can assure you it displays fine in every version of Safari. Actually, I believe a browser that doesn't support gzip (that is, ancient ones) would identify this in its request header, and a properly configured server would send the content uncompressed.

It sounds like you're maybe trying to compress your JS files before upload, instead of letting the server handle it, maybe? If so, that's the issue--maybe other browsers attempt to decompress on the fly and Safari sticks closer to the spec (and/or MIME type, which may be wrong if you gzipped it manually) so treats it as a file, rather than JS.
 
Ok. I'll take a look at having the server GZIP for me. I was manually GZIPing the files. Thanks.
 
I've enabled GZIPing successfully and I have confirmed that. I ended up using SmartOptimizer to strip and gzip my javascript and css. Thanks.

I have just one issue though... When I take a look at my page load sizes in Safari's Web Inspector, it shows no change in page-load size. Should that happen? If I turn GZIP off, and look at the site, it is the same as it is when it is on.

Also, is 700kb (no refresh) to 500kb (after refresh) too large for my website size?

EDIT: Went over to Firefox (firebug) to test this. Figured out what was wrong. Safari was showing me the total size of the site after the browser had removed the gzip, so everything was at full size.

So, now, my question is if 300 kb being transferred too much?
 
So, now, my question is if 300 kb being transferred too much?

Is that web site or web page? I'd guess you mean web page. Partly depends on what type of content you're putting up. If it's mostly text, then that's a little high, but if it's a image or video gallery, then it might be reasonable. My home page, which only uses a small amount of layout graphics and the rest is text is 21KB. One of my artwork pages where I have about 15 thumbnails and descriptions the page size is only 100KB. So from that perspective, your size seems kind of large, but really does depend on the content.
 
Its a blog. It uses a decent amount of images for the design, some post images, javascript to make it dynamic, text, and stylesheet. The largest chunk of the page size is due to the images.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.