自动刷新由php中的缓存系统生成的页面html

时间:2016-04-15 09:23:53

标签: php html caching

所以我刚刚在php中找到了系统缓存的建立,但我需要了解一件事。我有一个index.php文件,我在此文件中包含两个文件cache-top.phpcache-bottom.php,我生成一个index.html文件,我也更改了文件的名称{{1当您进入网站时,index.php中的first.php页面会落在index.html页面上。系统运行良好,因为我有一个生成的文件,但我觉得index.html文件在2min后没有改变,因为我在“cache -top”文件中配置刷新index.html的内容必须刷新页面first.php并想知道这是否正常?什么是index.html文件刷新其内容而不刷新first.php的解决方案?

cache-top.php代码:

$expireTime = time () -120 ;
$caching = FALSE ;

$cacheFile = "index.html";

If( file_exists($cacheFile) ) {
    if (filemtime($cacheFile) < $expireTime) {
        ob_start();
    } else {      
        $caching = TRUE ;
         readfile($cacheFile);
    }
} else {
    ob_start() ;
}

提前谢谢

0 个答案:

没有答案