Cache Page Script
Copy this code and paste it in your HTML
if (isset($useCache) && $useCache==1){ if (isset($_SERVER['REQUEST_URI']) && $_SERVER['REQUEST_URI']!="/"){ $cacheName=str_replace('/','-',$_SERVER['REQUEST_URI']); $cacheName = substr($cacheName,1); }else{
$cacheName='site-index.html';
}
$cacheFile = "cache/{$cacheName}";
$cacheTime = 4 * 60;
}
include($cacheFile);
}
}
/************** Body of site **************/
if (isset($useCache) && $useCache==1){ // Firstly we check, is caching enabled for this page, if yes do your best my script:) $cached = fopen($cacheFile, 'w'); }
URL: http://paste.org/5666
Report this snippet
Comments
Subscribe to comments