Merhaba,
sistemimde cache sistemi kullanıyorum. Bu kullandıgım fonksiyon php sayfalarını html olarak kayıt ediyor.
ama 2 günde 1 cache yapısını yenilemesi için tarih fonksiyonu var çalışmıyor.
Hiç cache yenilemesi yapmıyor yani
sistemimde cache sistemi kullanıyorum. Bu kullandıgım fonksiyon php sayfalarını html olarak kayıt ediyor.
ama 2 günde 1 cache yapısını yenilemesi için tarih fonksiyonu var çalışmıyor.
Hiç cache yenilemesi yapmıyor yani
PHP:
$cachesystem = 'yes';
$rootpath='./';
$cache = 'cache';
//---------------------------------
//---- CACHE MOD v0.4 by xam
//---------------------------------
function cache_check ($file = 'cachefile') {
global $cache,$rootpath,$cachesystem;
if ($cachesystem == 'yes') {
$cachefile = $rootpath.$cache . '/'.$file.'.html';
$cachetime = 2400 * 60; // 2 Hours
$updatetime = $cachetime / 60 / 60;
if (file_exists($cachefile) && (TIMENOW - $cachetime < filemtime($cachefile)))
{
include_once($cachefile);
// print("<p align=center><font class=small color=red><b>This content was last cached on ".date('Y-m-d H:i:s', filemtime($cachefile))." and updating every ".$updatetime." hours.</b></font></p>");
exit;
}
ob_start();
}else
return;
}
function cache_save ($file = 'cachefile') {
global $cache,$rootpath,$cachesystem;
if ($cachesystem == 'yes') {
$cachefile = $rootpath.$cache . '/'.$file.'.html';
$fp = fopen($cachefile, 'w');
fwrite($fp, ob_get_contents());
fclose($fp);
ob_end_flush();
}else
return;
}
//---------------------------------
//---- CACHE MOD v0.4 by xam
//---------------------------------