国产成人精品久久免费动漫-国产成人精品天堂-国产成人精品区在线观看-国产成人精品日本-a级毛片无码免费真人-a级毛片毛片免费观看久潮喷

您的位置:首頁技術文章
文章詳情頁

使用 php4 加速 web 傳輸

瀏覽:2日期:2024-01-16 18:52:25
<? /*************************************** ** 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
主站蜘蛛池模板: 99国产高清久久久久久网站 | 韩国一级毛片在线观看 | 一级一级一片免费高清 | 国产亚洲精品影达达兔 | 手机看片久久青草福利盒子 | 日本欧美不卡一区二区三区在线 | 亚洲成a人v在线观看 | 精品国产香蕉在线播出 | 亚洲精品专区一区二区三区 | 男人的天堂在线观看视频不卡 | 黄色一级网址 | 亚州免费视频 | 欧美第一页草草影院浮力 | www国产 | 国产亚洲精品成人一区看片 | 欧美高清免费一级在线 | 香蕉久久夜色精品国产 | 国产一区高清 | 久久se精品一区精品二区 | 特级毛片aaaa级毛片免费 | 日本欧美一区二区三区高清 | 悠悠影院欧美日韩国产 | 免费观看一级欧美大 | 国产成人理在线观看视频 | 91精品免费国产高清在线 | 欧美三级美国一级 | 亚洲成a人| 精品国产中文一级毛片在线看 | 欧美亚洲国产精品久久 | 久草不卡视频 | 欧美91精品久久久久网免费 | 久久亚洲精品中文字幕第一区 | 国产黄色a三级三级三级 | 另类一区二区三区 | 亚洲男人的天堂久久精品 | 成人观看网站a | 亚洲国产91 | 最近手机中文在线视频 | 色综合a怡红院怡红院首页 色综合精品久久久久久久 色综合九九 | 综合欧美视频一区二区三区 | 国产成人麻豆tv在线观看 |