$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;
}
}
}

相关文章:

  • 2021-07-02
  • 2021-08-24
  • 2022-12-23
  • 2021-11-11
  • 2022-01-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-04-08
  • 2021-07-05
  • 2021-12-06
  • 2021-12-04
  • 2022-12-23
  • 2021-06-29
  • 2021-10-10
相关资源
相似解决方案