Title: Accelerates network transmission using PHP4.
?
/***************************************
* * Title ...: PHP4 HTTP Compression speeds up the Web
* * Version ...: 1.10
* * Author ...: Catoc <catoc@163.net>
* * Filename ...: gzdoc.php
* * Last changed.: 25/08/2000
* * Requirments ...: PHP4 >= 4.0.1
* * PHP is configured with--with-zlib[=dir]
* * Notes ...: Dynamic Content acceleration Compresses
* * The data transmission data on the fly
* * Code by Sun Jin Hu (catoc) <catoc@163.net>
* * 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'll then
* * Compress the data and transmit it. The
* * Browser decompresses it and then renders
* * the page.
* * Useage ...:
* * No Space before the beginning of the ' the '
.
* *------------Start of File----------
* * |<?
** | Include (' gzdoc.php ');
** | print "Start output!!";
** |? >
* * |* * | ... the page ...
* * |* * |<?
** | Gzdocout ();
** |? >
* *-------------end of File-----------
***************************************/
Ob_start ();
Ob_implicit_flush (0);
function GetHeader () {
$headers = Getallheaders ();
while (the 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 ')) {
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.