添加super cache插件

November 14th, 2008 | Categories: Favorites | Tags:

WordPress wp-cache插件的原作者又推出了wp-super-cache 插件,对每一个php页面缓存为HTML格式返回。

通过简单测试,网页单线程下载的性能数据如下,

C:\>perl accessHTML.pl          yumianfeilong.com with supper cache disabled
start at 2008/11/14   11:51:27
End at 2008/11/14   11:52:59
~ 92 Seconds

C:\>perl accessHTML.pl          yumianfeilong.com with supper cache enabled
start at 2008/11/14   11:43:02
End at 2008/11/14   11:44:17
~ 75 Seconds

C:\>perl accessHTML.pl          dbanotes.net
start at 2008/11/14   11:50:09
End at 2008/11/14   11:50:57
~ 48 Seconds

不过仍然和其他的仍然有差距,可能是我动态插件广告等添加的太多了。

测试的简单perl代码

#!/usr/bin/perl
use Time::Local;
use LWP::UserAgent;

my $endtime;
my $starttime;
my $elaspedtime;

$starttime = time();

my @array=(localtime)[5,4,3,2,1,0];
$array[0]+=1900;
$array[1]+=1;
my $nowtime=sprintf(”%04u/%02u/%02u %02u:%02u:%02u”,@array);
print(”start at “.”$nowtime\n”);

for($i = 1; $i < 30; $i++) {
$url=”http://www.yumianfeilong.com”;
$ua = LWP::UserAgent->new();
$res=$ua->request( HTTP::Request->new(’GET’,$url));

if ($res->is_success)
{
$countoflines=10000;
$randnum = int(rand($countoflines));
$dmpfile = “htmlfile.$randnum.html”;
open DMPFILE,”>$dmpfile” or die “Can not open and write to $dmpfile”;
print DMPFILE $res->content;
close(DUMPFILE);
unlink(”$dmpfile”);
}
else
{
print (”Error: ” . $res->status_line . “\n”) ;
}
}#end for loop

$endtime = time();

#print “Total elasped time is ” . $endtime - $starttime . ” seconds. \n”;
my @array=(localtime)[5,4,3,2,1,0];
$array[0]+=1900;
$array[1]+=1;
my $nowtime=sprintf(”%04u/%02u/%02u %02u:%02u:%02u”,@array);
print(”End at “.”$nowtime\n”);

Del.icio.us Google书签 Digg Live Bookmark Technorati Furl Yahoo书签 Facebook 百度搜藏 新浪 ViVi 365Key 网摘 天极网摘 和讯网摘 博拉网 POCO 网摘 饭否 QQ 书签 Digbuzz 我挖网 Mister Wong
No comments yet.