jpcache v2
http://www.jpcache.com/

Copyright 2001-2003 Jean-Pierre 'Pier' Deckers <jp@jpcache.com>
  
  Summary:
    jpcache is a lightweight, full page caching system for PHP, thus
    reducing server-load, as pages are generated less often.
    It also uses gzip content-encodig and ETag-headers, which results
    in around 80% in traffic-saving for php-pages.
    You can choose to store your files in a local dir or in a database.
  
  Features:
    - Caches full pages.
    - When not modified since last visit, sends 304 response
    - When modified or first visit, sends gzipped content if possible, 
      else uncompressed content
    - You can choose between file or MySQL based storage, or adapt the
      template for your own storage system, like dbm.
      
  Requirements:
    - PHP4.1.0+ with Zlib enabled
    - MySQL when using the sql-version etc.

  Release-notes for v2
    - Totally rewritten the 1.1 code, seperated main-code from storage-system
    - Merged lots of suggestions, patches etc. Should now be Windows-compatible
      out of the box.
    See www.jpcache.com for the full changelog.
          
  File vs. sql-storage:
    Although the file-storage seems to be faster, you might prefer the 
    sql-version, as it has much faster garbagecollection. 
    
    I recommend using the sql-based storage if the cache-files are always 
    of size 0:
    "On some operating systems flock() is implemented at the process level. 
    When using a multithreaded server API like ISAPI you may not be able to 
    rely on flock() to protect files against other PHP scripts running in 
    parallel threads of the same server instance!" --- PHP.net
    
  Installation and usage:
    0) Decide whether to go for the file- or database-storage.
    1) Edit jpcache.php and change the includedir-setting to the directory
       which contains the jpcache programfiles.
    2) Edit jpcache-config.php and change the configurationsettings. 
       Do not forget to uncomment the JPCACHE_TYPE setting for the storagemode
       you want to use.
       If you choose for filebased-storage, make sure that the directory is
       writeable for the apache-user (normally nobody)
       If you use the mysql-storage, enter the correct settings for accessing 
       the database.
    3) If you use the sql-version, create the database that is used for storing
       the cachedata (default name: "jpcache"). Within this database, create 
       the required table as provided in script.sql.
       You can use the mysql-client for this:
       mysql <db-name> < script.sql
       or you can use phpMyAdmin <http://phpwizard.net/phpMyAdmin> to read
       in the dump.
    4) You can easily test jpcache with the following file:
       <?php
        require "jpcache.php";
        echo time();
        phpinfo();
       ?>
       Request this file from you browser, refresh, and see if the time written
       is the same. 
    5) If everything works, edit your php-files and add (directly to the top):
            <? $cachetimeout=<X>; require "/path/to/jpcache/jpcache.php" ?>
       - Replace <X> with the number of seconds that the page should be cached.
       By default, pages will be cached for 900 seconds.
       - Setting <X> to -1 will disable caching and will only do content 
       encoding. Use this for pages which can not be cached, like personalized
       pages or with content that is always changing. Also when the page is 
       returning headers (like cookies in php), set the cachetimeout to -1, as
       header-information is not cached.
       - Setting <X> to 0 will create a non-expiring cache. This can be used 
       for pages that are not dynamic in content, but are heavy to generate.

Debugging:
    jpcache can output debug-information, and does this by setting X-Debug 
    headers. Set $DEBUG to 1, and view the HTTP-headers with a tool like
    http://www.edginet.org/cgi-bin/http_head.cgi 
    This one also allows you to check if gzip is working.
    If offline, google for 'HTTP Header Viewer'
     
Credits:
    The following people have helped, tested, submitted suggestions or 
    code-updated for jpcache (in no particular order):
    
    // TODO, screen mailbox
    
For more help, please see http://www.jpcache.com/, it contains a list of the
most frequently asked questions, and maybe I've added more information.

If you successfully deploy jpcache on your servers, please add text link or 
link the button back to www.jpcache.com, or atleast let me know, so I can keep
track of the sites using jpcache.

     
Jean-Pierre 'Pier' Deckers