Login   Register  
PHP Classes

File: test1.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Cesar D. Rodas  >  gCache  >  test1.php  >  Download  
File: test1.php
Role: Example script
Content type: text/plain
Description: Test File
Class: gCache
Capture and cache Web page content
Author: By
Last change: Version 3.0.
+ Complete rewrite from the scratch, to improved the reponse time
+ Saves two cache, the compressed and uncompressed one. Useful for keep bandwidth.

ToDo for 3.1:
+ Add again support for file locking with not flock.
+ Add a way to mark some files in the cache to re-build ASAP.
+ Add "foldering" feature, which will spread the cache accross a set of sub directories.
Date: 6 years ago
Size: 1,195 bytes


Class file image Download
$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()) {
} 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>