• 01-08-2015, 23:51:00
    #1
    Üyeliği durduruldu
    Merhaba,

    Bir cache dosyam mevcut.Normalde hangi sayfaya girilirse o sayfayı cacheliyor fakat ben istiyorum ki bütün etiket ana sayfa vesaire herşeyi bir kerede cacheletmek.Kod aşağıda. Ücretli destek bekliyorum.
     <?php
    $ftp_cache = 15; // dakika cinsinden
    function cache_baslat(){
    	global $ftp_cache;
    	$filename = md5($_SERVER['REQUEST_URI']).'.html';
    	$cachefile = 'x/'.$filename;
    	define('_CACHEDOSYASI', $cachefile);
    	$zaman = 60 * $ftp_cache;
    	$cachetime = $zaman;
    	if (file_exists($cachefile)){
    		if(time() - $cachetime < filemtime($cachefile)){
    			readfile($cachefile);
    			exit;
    		}else{
    			unlink($cachefile);
    		}
    	}
    	ob_start();
    }
    function cache_bitir(){
    		$fp = fopen(_CACHEDOSYASI, 'w+');
    		fwrite($fp, ob_get_contents());
    		fclose($fp);
    		ob_end_flush();
    }
    	
    ?>
  • 02-08-2015, 13:07:42
    #2
    pm gönderildi.
  • 02-08-2015, 14:49:27
    #3
    Üyeliği durduruldu
    gurkanbicer adlı üyeden alıntı: mesajı görüntüle
    pm gönderildi.
    ekledim skype