GeorgeC
07-22-2002, 08:42 AM
This may sound like a silly question, but from people's experience, is gzip a reliable compression method for outputting any kind of page, or just one composed mostly of text/images? I ask this because I'm thinking of enabling gzip on our site dynamicdrive.com, which consists of sample DHTML (JavaScript) codes throughout its pages. I hate to have gzip mess things up in some browsers.
Thanks,
infinite
07-22-2002, 02:47 PM
Originally posted by GeorgeC
This may sound like a silly question, but from people's experience, is gzip a reliable compression method for outputting any kind of page, or just one composed mostly of text/images? I ask this because I'm thinking of enabling gzip on our site dynamicdrive.com, which consists of sample DHTML (JavaScript) codes throughout its pages. I hate to have gzip mess things up in some browsers.
Thanks,
It won't make much difference to image files it they are already compressed. It's usually just used on text files. Having it on image files may create a high load on your server, and isn't recommended ;). It will only work with browsers that accept the encoding, so it shouldn't mess up other browsers, it should be fine with any text file. Why not try it out on certian directorys only to start with?
HTH,
Infinite ;)
esdjco
07-22-2002, 07:30 PM
Just don't use it for images and you should be good to go. I believe it isn't to hard to do for simple html pages.
GeorgeC
07-22-2002, 07:46 PM
Originally posted by infinite
Why not try it out on certian directorys only to start with?
HTH,
Infinite ;)
Thanks for the info. Unfortuantely I don't have the luxury of testing it out, as my current host doesn't support it, and the new host I'm looking to move to has gzip installed by default.
infinite
07-23-2002, 04:49 PM
Originally posted by GeorgeC
Thanks for the info. Unfortuantely I don't have the luxury of testing it out, as my current host doesn't support it, and the new host I'm looking to move to has gzip installed by default.
If you can use php, there is a way, you can find an example on php.net, I think. It's not mod_gzip, but it will achive the same effect :) (zlib compression link (http://www.php.net/manual/en/ref.zlib.php) )
Or you could do it this way ;; You can redirect all of the output of your scripts to a function. For
; example, if you set output_handler to "ob_gzhandler", output will be
; transparently compressed for browsers that support gzip or deflate encoding.
; Setting an output handler automatically turns on output buffering.
;output_handler =
output_handler = ob_gzhandler But I can't see how you can do it simply, without using mod_gzip ;)
HTH,
Infinite :D
Ahmad
07-23-2002, 06:50 PM
mod_gzip is very good for text.
Including HTML, JavaScript, CSS .. etc.
It will reduce your bandwith usage, probably to a great extent.
Running it on images will be a waste of CPU cycles, but that's your hosts job to configure.