<? /*************************************** ** title.........: php4 http compression speeds up the web ** version.......: 1.10 ** author........: catoc <[email protected]> ** filename......: gzdoc.php ** last changed..: 25/08/2000 ** requirments...: php4 >= 4.0.1 ** php was configured with --with-zlib[=dir] ** notes.........: dynamic content acceleration compresses ** the data transmission data on the fly ** code by sun jin hu (catoc) <[email protected]> ** most newer browsers since 1998/1999 have ** been equipped to support the http 1.1 ** standard known as "content-encoding." ** essentially the browser indicates to the ** server that it can accept "content encoding" ** and if the server is capable it will then ** compress the data and transmit it. the ** browser decompresses it and then renders ** the page. ** useage........: ** no space before the beginning of the first '<?' tag . ** ------------start of file---------- ** |<? ** | include('gzdoc.php'); ** | print "start output !!"; ** |?> ** |<html> ** |... the page ... ** |</html> ** |<? ** | gzdocout(); ** |?> ** -------------end of file----------- ***************************************/ ob_start(); ob_implicit_flush(0); function getheader(){ $headers = getallheaders(); while (list($header, $value) = each($headers)) { $message .= "$header: $value<br> "; } return $message; } function checkcangzip(){ global $http_accept_encoding, $php_self, $wget, $remote_addr, $s_username; if (connection_timeout() || connection_aborted()){ return 0; } if ((strpos('catoc'.$http_accept_encoding, 'gzip')) || $wget = = 'y'){ if (strpos('catoc'.$http_accept_encoding, 'x-gzip')){