//6小时更新一次首页


$cachetime = 360;//6小时更新一次首页
 
if($cachetime) {
$cachefile = S_ROOT.'./data/data_index.php';
$lockfile = S_ROOT.'./data/data_index.lock';

if(file_exists($cachefile)) {
@$mktime = filemtime($cachefile);
if($_SGLOBAL['timestamp'] - $mktime > $cachetime*60) {
if(file_exists($lockfile)) {
$writestate = false;
@touch($lockfile);
}

} else {
include_once($cachefile);
$cachelost = false;
}
}
}

你可能感兴趣的:(//6小时更新一次首页)