> Chris Kirkland

67 Items, latest addition, Mon, 4th June 2007
 

Compress web pages for fast delivery

29/08/2003

HTTP Overclocking!
if you didn't know already, you can send stuff at a browser (IE, mozilla, opera etc.) nowadays in gzip format - WOW. So this means reducing you web page sizes by typically 50-80%. I know two ways of doing this.

With php
This is so much fun! just use:

ob_start("ob_gzhandler");

put this at the top of your script, after any headers output - and that's it!

I believe you can also get php to do this by default with zlib, try here for more info:


http://www.webcompression.org/php-compress.html

With the webserver (Apache or IIS)

With apache you can use mod_gzip or mod_deflate, and tell it to compress html php css etc.
This is something for the server admin to do, here's some links more info:

http://www.webcompression.org/gzip-compress.html
http://www.webcompression.org/deflate-compress.html

If you wanna know what to do with IIS try here:
http://www.15seconds.com/issue/020314.htm

test it out:
http://leknor.com/code/gziped.php?url=http%3A%2F%2Fwww.chriskirkland.net