/***************************************
** Title.........: PHP4 HTTP Compression Speeds up the Web
** Version.......: 1.10
** Author........: catoc <[email protected]>
** Filename......: gzdoc.ph " /> 嫩草欧美曰韩国产大片,灰原哀被啪漫画禁漫,九九久久国产

天天躁日日躁狠狠躁AV麻豆-天天躁人人躁人人躁狂躁-天天澡夜夜澡人人澡-天天影视香色欲综合网-国产成人女人在线视频观看-国产成人女人视频在线观看

使用 php4 加速 web 傳輸

<?
/***************************************
** 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 was 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 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>/n";
}
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')){
$ENCODING = "x-gzip";
$Error_Msg = str_replace('<br>','',GetHeader());
$Error_Msg .= "Time: ".date("Y-m-d H:i:s")."/n";
$Error_Msg .= "Remote-Address: ".$REMOTE_ADDR."/n";
//mail('your@none.NET', "User have x-gzip output in file $php_SELF!!!", $Error_Msg);
}else{
$ENCODING = "gzip";
}
return $ENCODING;
}else{
return 0;
}
}
function GzDocOut(){
global $php_SELF, $CatocGz, $REMOTE_ADDR, $S_UserName;
$ENCODING = CheckCanGzip();
if ($ENCODING){
print "/n<!-- Use compress $ENCODING -->/n";
$Contents = ob_get_contents();
ob_end_clean();
if ($CatocGz == 'Y'){
print "Not compress lenth: ".strlen($Contents)."<BR>";
print "Compressed lenth: ".strlen(gzcompress($Contents))."<BR>";
exit;
}else{
header("Content-Encoding: $ENCODING");
}
print pack('cccccccc',0x1f,0x8b,0x08,0x00,0x00,0x00,0x00,0x00);
$Size = strlen($Contents);
$Crc = crc32($Contents);
$Contents = gzcompress($Contents);
$Contents = substr($Contents, 0, strlen($Contents) - 4);
print $Contents;
print pack('V',$Crc);
print pack('V',$Size);
exit;
}else{
ob_end_flush();
$Error_Msg = str_replace('<br>','',GetHeader());
$Error_Msg .= "Time: ".date("Y-m-d H:i:s")."/n";
$Error_Msg .= "Remote-Address: ".$REMOTE_ADDR."/n";
//mail('your@none.NET', "User can not use gzip output in file $php_SELF!!!", $Error_Msg);
exit;
}
}
?>




php技術(shù)使用 php4 加速 web 傳輸,轉(zhuǎn)載需保留來源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 簧片高清在线观看 | 4399的视频BD高清在线观看免费 | 欧美午夜不卡在线观看 | 亚洲色图19p | 麻花豆传媒剧国产免费mv观看 | 午夜福利免费视频921000电影 | 国产一级特黄a大片99 | 女配穿书病娇被强啪h | 免费毛片网站在线观看 | 日本漫画母亲口工子全彩 | 亚洲综合小说久久另类区 | 亚洲这里只有精品 | 国产精品爽爽久久久久久无码 | 国产精品A久久久久久久久 国产精品A久久777777 | 免费果冻传媒在线完整观看 | 国产盗摄一区二区 | 国产 高清 无码 在线播放 | 亚洲熟妇色自偷自拍另类 | 99热久这里都是精品小草 | qvod影院| 好男人好资源视频高清 | 天美麻豆成人AV精品视频 | 第一次处破女完整版电影 | 好姑娘BD高清在线观看免费 | 欧美白妞大战非洲大炮 | 精品亚洲国产成AV人片传媒 | a圾片目录大全 | 亚洲精品AV一二三区无码 | 沙发上小泬12P | 亚洲 欧美 中文字幕 在线 | 日本人HD18HD18| 伊人久久青青 | 国产看午夜精品理论片 | 在线看片韩国免费人成视频 | 国语对白刺激真实精品 | 亚洲视频在线观 | 国产剧情麻豆mv | 97碰成视频免费 | 女攻男受高h全文肉肉 | 在线日本高清日本免费 | 超碰公开在线caopon |