php 简单的缓存全站函数介绍
$refresh ){//缓存超时 register_shutdown_function(cache_page_go,$file);// 调用函数 } else{//正常使用缓存文件 $f=file_get_contents($file);// 取出缓存文件内容 echo $f.缓存的哦;//输出缓存内容 $output=ob_get_contents(); //取出缓冲区内容 ob_get_clean(); //清空缓冲区 echo $output; //输出 exit(); }}}function cache_page_go($file){$output=ob_get_contents();//获取缓冲区内容 ob_get_clean(); //清空缓冲区 file_put_contents($file,$output,lock_ex);//写入缓存文件 echo $output.新建的哦;//输出缓存内容 exit();}?>
http://www.bkjia.com/phpjc/486191.htmlwww.bkjia.comtruehttp://www.bkjia.com/phpjc/486191.htmltecharticlephp 简单的缓存全站函数介绍 ?php function cache_page($refresh=20){ ob_start();//开启缓冲区 $hash=sha1($_server[php_self].|g|.serialize($_get).|p|.serialize($_post));...