<?php
require('../secache/secache.php');
$cache = new secache;
$cache->workat('cachedata');
$str=$_GET["str"];
$key = md5($str);
$value = "select *from userinfo";
if($cache->fetch($key,$v)){
echo "havecache<br>";
if($cache->fetch(md5("time".$str),$num1)){
echo "not first time access=>";
echo $num1;
$cache->store(md5("time".$str),$num1+1);
}else{
echo "first time access";
$cache->store(md5("time".$str),1);
}
echo '<li>'.$key.'=>'.$v.'</li>';
}else{
$cache->store($key,$value);
echo '<li>Data get failed! <b>'.$key.'</b></li>';
}
echo $num1."<br>";
if($num1<10){
echo "正常调用";
}else{
echo "请稍候重试";
}
?>