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 微信会员卡接入微信支付商户号收款
    • ¥15 如何获取烟草零售终端数据
    • ¥15 数学建模招标中位数问题
    • ¥15 phython路径名过长报错 不知道什么问题
    • ¥15 深度学习中模型转换该怎么实现
    • ¥15 HLs设计手写数字识别程序编译通不过
    • ¥15 Stata外部命令安装问题求帮助!
    • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
    • ¥15 TYPCE母转母,插入认方向
    • ¥15 如何用python向钉钉机器人发送可以放大的图片?