/***************************************
** 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)系我們修改或刪除,多謝。

主站蜘蛛池模板: 麻豆国产人妻欲求不满 | 综合精品欧美日韩国产在线 | 999久久狠狠免费精品 | 囯产精品久久久久久久久免费蜜桃 | 欧美一级久久久久久久大 | 日本阿v在线资源无码免费 日本阿v片在线播放免费 | 一道精品视频一区二区 | 成人国产亚洲欧美成人综合网 | 99久久免费只有精品 | 国产精品嫩草影院在线观看免费 | 少妇被躁爽到高潮无码久久 | 日本熟妇乱妇熟色A片蜜桃 日本熟妇多毛XXXXX视频 | 麻豆精品传媒卡一卡二传媒短视频 | 511麻豆视传媒精品AV | vivoe另类| 黑色丝袜美腿美女被躁翻了 | 久久综合狠狠综合狠狠 | 国产51麻豆二区精品AV视频 | 小护士大pp | 99久久久免费精品国产 | 最近高清中文字幕无吗免费看 | 久久成人国产精品一区二区 | 1300部真实小Y女视频合集 | 99精品国产福利在线观看 | 吻嘴胸全身好爽床大全 | 2019久久这里只精品热在线观看 | 3d无遮挡h肉动漫在线播放 | 伊人久久大香线蕉观看 | 野花香在线观看免费高清播放视频 | 小小水蜜桃视频高清在线播放 | 国产成人免费高清激情视频 | 精品久久久无码21P发布 | 99久久伊人一区二区yy5099 | 高肉黄暴NP文公交车 | 久久国产乱子伦精品免费不卡 | 久久涩视频 | 午夜爽喷水无码成人18禁三级 | 99久久久无码国产精精品 | 伊人久久综合影院首页 | 亚洲综合AV在线在线播放 | 国产精品美女久久久久AV超清 |