İyinet'e Hoşgeldiniz!

Türkiye'nin En Eski Webmaster Forum'una Hemen Kayıt Olun!

Kayıt Ol!

cache sisteminde sorun

i.ari

0
İyinet Üyesi
Katılım
16 Aralık 2006
Mesajlar
4,437
Reaction score
6
Konum
Ankara
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 :(

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
//---------------------------------
 

Türkiye’nin ilk webmaster forum sitesi iyinet.com'da forum üyeleri tarafından yapılan tüm paylaşımlardan; Türk Ceza Kanunu’nun 20. Maddesinin, 5651 Sayılı Kanununun 4. maddesinin 2. fıkrasına göre, paylaşım yapan üyeler sorumludur.

Üst