douci2015 2016-04-15 09:23
浏览 36

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

So I just found out the establishment of a system cache in php, but I need to understand one thing . I have an index.php file and I included this file has two files cache-top.php and cache-bottom.php and I generate an index.html file , I also change the name of my file index.php in first.php to fall on the index.html page when you enter the site. The system works well because I have a file that is generated, but I feel that the index.html file does not change after 2min as I configured in the "cache -top" file for refresh the content of index.html must refresh the page first.php and wanted to know if this is normal ? and what is a solution for the index.html file to refresh its content without refreshing first.php ?

cache-top.php code :

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

thank you in advance

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 UE5#if WITH_EDITOR导致打包的功能不可用
    • ¥15 关于#stm32#的问题:CANOpen的PDO同步传输问题
    • ¥20 yolov5自定义Prune报错,如何解决?
    • ¥15 电磁场的matlab仿真
    • ¥15 mars2d在vue3中的引入问题
    • ¥50 h5唤醒支付宝并跳转至向小荷包转账界面
    • ¥15 算法题:数的划分,用记忆化DFS做WA求调
    • ¥15 chatglm-6b应用到django项目中,模型加载失败
    • ¥15 CreateBitmapFromWicBitmap内存释放问题。
    • ¥30 win c++ socket