jpcache


  Summary:
    jpcache is a lightweight, full page caching app for PHP, used to
    reduce server-load by generating pages less often.
    It also gzips content which results in around 80% in traffic-saving. 
    You can choose to store your cached files in a directory or in a database.
  
  Features:
    - Full page caching.
    - 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.
      
  Sites using jpcache:
    - Source Forge
    - Namespedia
    - Hubble Site
    - UK Directory
    - PHP Slash

  Requirements:
    - PHP4.1.0+ with Zlib enabled
    - MySQL when using the sql-version etc.


  Download: jpcache

News:

In early 2008 jpcache had been taken over and renamed QuickCache. Unfortunately no new updates.



jpcache v2
April 3, 2005: Seems that after 2 years, I need to incorporate the patches users committed :) Just moved the site over to a new server, expect CVS-updates soon (in the upcoming weeks). jpcache is a lightweight, full page caching system for PHP, thus reducing server-load, as pages are generated less often. It dramatically speeds up the serving of your pages, by caching the ouput of pages and returning them instead of compiling the php-page. 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 the cached output in files in a local dir or in a database. jpcache has been released under the GNU Public License (GPL). If you are using jpcache on your site(s), please show your appreciation by putting a link back to this site.

Features: Caches full php pages for seconds 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 Takes GET and POST data into account when caching

Requirements: - PHP4.1.0+ with Zlib enabled - And of course MySQL when using the sql-version

Quick usage: Edit jpcache.php and change the includedir-setting to the path of the jpcache files Edit jpcache-config.php and change the configurationsettings Start your file with < $cachetimeout=; include "jpcache.php" > Setting to -1 will disable caching and will only do content encoding. This can be used for pages that are not cacheable due to user-specific content (polls, personalization etc.)

Please see the manual for a full overview of possible options.

Bug in IE6 widely reduces use of ETag Please see my message in microsoft.public.windows.inetexplorer.ie6.browser You can test it for yourself here. After refreshing the page, the IF_NONE_MATCH should be set, however, 2 IE6sp2 on XP I've tested with didn't! This affects jpcache, as well as all other code that sends gzippped encoded content in combination with ETag-headers. Can anyone confirm this bug ?

First version was based upon and inspired by phpCache.

Text on this page was recovered by ana.
Manual
Coming soon. For now, a straight copy-and-paste from the readme-file:

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

Copyright 2001-2003 Jean-Pierre 'Pier' Deckers 
  
  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  < script.sql
       or you can use 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=; require "/path/to/jpcache/jpcache.php" ?
       - Replace  with the number of seconds that the page should be cached.
       By default, pages will be cached for 900 seconds.
       - Setting  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  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