Location: PHPKode > scripts > gCache > gcache/test1.php
$cache = new gCache;
$cache->folder = "./cache/";
$cache->timeout = 1;
/* its mean gCache cached the whole page */
/* so, gcache, decide if he must response the compressed or */
/* uncompressed cache*/
$cache->isPage = true; 
if ($cache->Valid()) {
	echo $cache->content;
} else {
<title>Cached page</title>
<body bgcolor="#CCCCCC">
	<h1>Testing Cesar D. Rodas' gCache Class</h1>
	<h2>Example of how to cache a hole page</h2>
<p>Basicaly what the gCache do, is to store a web-page or a portion of it into 
  a<em> <em>cache file</em>. </em>The <em><em>cache file</em></em> has a $timeout 
  in second of cache vitality, after that the cache will be re-created.</p>
<p>Also this class provides and locking system which is not depending of POSIX 
  or other OS, this feature becomes to this class very portable.</p>
<font size="1">This cache page was generated at 
<?php echo date("Y/m/d H:i:s")?>
</font><font size="1"> by <a href="http://cesars.users.phpclasses.org/gcache">gCache</a> 
Return current item: gCache