jpcache unter Windows

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • jpcache unter Windows

    Hallo
    gibt es hier jemanden der sich mit dem php script "jpcache"
    auskennt.??
    Ich bekomme es unter Windows nicht ans laufen.
    Oder kennt jemand ein aehnliches Script für den gleichen Zweck ??

    Bernd

  • #2
    Ich kenne das Skript nicht.
    Was macht dieses Skript, oder was sollte es machen?
    Welchem Zweck sollte es dienen?
    Hast Du einen Link wo man sich schlau machen kann?

    Kommentar


    • #3
      http://www.jpcache.com

      Durch zufall gefunden.
      *winks*
      Gilbert
      ------------------------------------------------
      Hilfe für eine Vielzahl von Problemen!!!
      http://www.1st-rootserver.de/

      Kommentar


      • #4
        Fehlermeldungen

        Danke für die Antworten.Ja der Link ist richtig,folgende Fehlermeldungen bekomme ich.

        Warning: fopen("/tmp/jpcache-_php_php_exe:8ea6f84c0c9f2e4f2f5d790c7e3dd439", "r") - No such file or directory in D:\hp\tools\jpcache\jpcache.inc on line 135

        Warning: Supplied argument is not a valid File-Handle resource in D:\hp\tools\jpcache\jpcache.inc on line 136

        Bernd

        Kommentar


        • #5
          Re: Fehlermeldungen

          Warning: fopen("/tmp/jpcache-_php_php_exe:8ea6f84c0c9f2e4f2f5d790c7e3dd439", "r") - No such file or directory in D:\hp\tools\jpcache\jpcache.inc on line 135

          Warning: Supplied argument is not a valid File-Handle resource in D:\hp\tools\jpcache\jpcache.inc on line 136
          Poste mal den code von zeile 125 bis 140
          *winks*
          Gilbert
          ------------------------------------------------
          Hilfe für eine Vielzahl von Problemen!!!
          http://www.1st-rootserver.de/

          Kommentar


          • #6
            Danke

            Danke Wotan für die Antwort

            $CACHE_TIME=900; // Default: 900 - number seconds to cache
            $CACHE_DEBUG=0; // Default: 0 - Turn debugging on/off
            $SINGLE_SITE=1; // Default: 1 - No servername in file
            $CACHE_ON=1; // Default: 1 - Turn caching on/off
            $USE_GZIP=1; // Default: 1 - Whether or not to use GZIP
            $CACHE_POST=1; // Default: 1 - Should POST's be cached

            define(CACHE_DIR, "/tmp"); // Default: /tmp - Default cache directory
            define(CACHE_GC, 1); // Default: 1 - Probability of garbage collection (i.e: 1%)

            define(VERSION, "1.1.1"); // Version of jpcache

            ist Cache_DIR so richtig ??? (Windows)

            static $fp;
            if ($open)
            {
            $fp=fopen($file, "r");
            $ret=flock($fp, LOCK_EX);
            }
            else
            Fehlermeldung bezieht sich auf das fopen....kann aber nirgens woanders die Variable $file finden.

            Bernd

            Kommentar


            • #7
              Sorry ich kann dir bei dem Prob nicht helfen!

              Leider kann ich dir bei dem Prob nicht helfen, aber vieleicht kann es ja hand.
              *winks*
              Gilbert
              ------------------------------------------------
              Hilfe für eine Vielzahl von Problemen!!!
              http://www.1st-rootserver.de/

              Kommentar


              • #8
                Trotzdem Danke Wotan

                macht ja nix......
                bin nur kein grosser php spezialist.....
                würde das script nur gerne zum Laufen bringen....
                vielleicht meldet sich hand ja nochmal.

                Danke

                Bernd

                Kommentar


                • #9
                  fopen("/tmp/jpcache-_php_php_exe:
                  was soll das werden? würde der file nen gültigen namen haben, würde es auch klappen.
                  es gibt keine dateiendung, und "-_" in einem filename geht schon gar nicht ...
                  h.a.n.d.
                  Schmalle

                  http://impressed.by
                  http://blog.schmalenberger.it



                  Wichtige Anmerkung: Ich habe keine Probleme mit Alkohol ...
                  ... nur ohne :-)

                  Kommentar


                  • #10
                    richtig....

                    Hallo Schmalle

                    sehe ich auch so.....
                    kommt aber aus dem Script heraus ????

                    Bernd

                    Kommentar


                    • #11
                      dann musst du das script wohl ändern
                      h.a.n.d.
                      Schmalle

                      http://impressed.by
                      http://blog.schmalenberger.it



                      Wichtige Anmerkung: Ich habe keine Probleme mit Alkohol ...
                      ... nur ohne :-)

                      Kommentar


                      • #12
                        So.
                        Im File ipcache.inc ist die Definition für:
                        define(CACHE_DIR, "/tmp"); // Default: /tmp - Default cache directory

                        Gibt es physikalisch dieses Verzeichnis in Deinem Filesystem? Wenn nein lege das Verzeichnis c:\tmp an.

                        Ansonsten probiere es mal mit mit
                        define(CACHE_DIR, "c:\tmp");

                        Code:
                            function cache_lock($file, $open=TRUE) 
                            {
                                static $fp;
                                if ($open) 
                                {
                                    $fp=fopen($file, "r");  // Zeile 135, hier hauts das Skript auf
                                    $ret=flock($fp, LOCK_EX);
                                } 
                                else 
                                {
                                    if (!$fp)
                                    {
                                        cache_debug("Invalid file handle?!");
                                        $fp=NULL;
                                        return;
                                    }
                                    flock($fp, LOCK_UN) or die("Cannot Release Lock");
                                    fclose($fp);
                                    $fp=NULL;
                                }
                                return $ret;
                        
                            }

                        Kommentar


                        • #13
                          Danke aber...

                          Habe es schon mit C:\tmp und c:/tmp probiert....
                          Immer dasselbe......
                          Das Verzeichniss ist vorhanden....

                          ?????
                          Bernd

                          Kommentar


                          • #14
                            Die Funktion wird aufgerufen
                            // Make it a valid name
                            $cache_file=eregi_replace("[^A-Z,0-9,=]", "_", $cache_file);
                            ...
                            $cache_absfile=cache_storage($cache_file);
                            ...
                            $cache_file="jpcache-" . $cache_file . ":" . $key;

                            Ach was, ich poste gleich das ganze Skript, dann können mehrere mitschauen was sich da abspielt:
                            Code:
                            <?
                            
                            /*
                              jpcache.php v1.1.1 [2001-06-13]
                              Copyright  2001 Jean-Pierre Deckers <jpcache@weirdpier.com>
                            
                              This program is free software; you can redistribute it and/or
                              modify it under the terms of the GNU General Public License
                              as published by the Free Software Foundation; either version 2
                              of the License, or (at your option) any later version.
                            
                              This program is distributed in the hope that it will be useful,
                              but WITHOUT ANY WARRANTY; without even the implied warranty of
                              MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                              GNU General Public License for more details.
                            
                              You should have received a copy of the GNU General Public License
                              along with this program; if not, write to the Free Software
                              Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
                            */
                            
                            /*
                             Credits:
                            
                                Most things taken from 
                                    phpCache        <nathan@0x00.org> (http://www.0x00.org/phpCache)
                                    gzdoc.php       <catoc@163.net> and <jlim@natsoft.com.my> 
                                    jr-cache.php    <jr-jrcache@quo.to>
                            
                                Inspired by the following threads:
                                    [url]http://www.aota.net/ubb/Forum15/HTML/000738-1.html[/url]
                                    [url]http://www.aota.net/ubb/Forum15/HTML/000746-1.html[/url]
                                    [url]http://www.aota.net/ubb/Forum15/HTML/000749-1.html[/url]
                            
                             Note:
                                I do not claim anything. 
                                Just a first try to 'release' something under the GPL.
                            
                             More info on [url]http://www.weirdpier.com/jpcache/[/url]
                            
                             */
                             
                            /******************************************************************************/
                            
                                $CACHE_TIME=900;            // Default: 900 - number seconds to cache
                                $CACHE_DEBUG=0;             // Default: 0 - Turn debugging on/off
                                $SINGLE_SITE=1;             // Default: 1 - No servername in file
                                $CACHE_ON=1;                // Default: 1 - Turn caching on/off
                                $USE_GZIP=1;                // Default: 1 - Whether or not to use GZIP
                                $CACHE_POST=1;              // Default: 1 - Should POST's be cached
                                
                                define(CACHE_DIR, "/tmp");  // Default: /tmp - Default cache directory
                                define(CACHE_GC, 1);        // Default: 1 - Probability of garbage collection (i.e: 1%)
                                
                                define(VERSION, "1.1.1");   // Version of jpcache
                            
                            /******************************************************************************/
                            
                                /* This resets the cache state */
                                function jpcache_reset() 
                                {
                                    global $cache_absfile, $cache_data, $cache_variables;
                                    $cache_absfile  =NULL;
                                    $cache_data     =array();
                                    $cache_variables=array();
                                }
                            
                                /* Saves a variable state between caching */
                                function cache_variable($vn) 
                                {
                                    global $cache_variables;
                                    cache_debug("Adding $vn to the variable store");
                                    $cache_variables[]=$vn;
                                }
                            
                                /* Take a wild guess... */
                                function cache_debug($s) 
                                {
                                    global $CACHE_DEBUG;
                                    static $debugline;
                            
                                    if ($CACHE_DEBUG) 
                                    {
                                        $debugline++;
                                        header("X-Debug-$debugline: $s");
                                    }
                                }
                            
                                /* Generates the key for the request */
                                function cache_default_key() 
                                {
                                    global $HTTP_POST_VARS, $HTTP_GET_VARS;
                                    return md5("POST=" . serialize($HTTP_POST_VARS) . " GET=" . serialize($HTTP_GET_VARS));
                                }
                            
                                /* Returns the default object used by the helper functions */
                                function cache_default_object() 
                                {
                                    global $SCRIPT_URI, $SERVER_NAME, $SCRIPT_NAME, $SINGLE_SITE;
                            
                                    if ($SINGLE_SITE)
                                    {
                                        $name=$SCRIPT_NAME;
                                    } 
                                    else 
                                    {
                                        $name=$SCRIPT_URI;
                                    }
                            
                                    if ($name=="") 
                                    {
                                        $name="http://$SERVER_NAME/$SCRIPT_NAME";
                                    }
                                    return $name;
                                }
                            
                                /* Caches the current page based on the page name and the GET/POST
                                    variables.  All must match or else it will not be fectched
                                    from the cache! */
                                function cache_all($cachetime=120) 
                                {
                                    $key=cache_default_key();
                                    $object=cache_default_object();
                                    return cache($cachetime, $object, $key);
                                }
                            
                                /* Obtain a lock on the cache storage, this can be stripped out
                                    and changed to a different handler like a database or
                                    whatever */
                                function cache_lock($file, $open=TRUE) 
                                {
                                    static $fp;
                                    if ($open) 
                                    {
                                        $fp=fopen($file, "r");
                                        $ret=flock($fp, LOCK_EX);
                                    } 
                                    else 
                                    {
                                        if (!$fp)
                                        {
                                            cache_debug("Invalid file handle?!");
                                            $fp=NULL;
                                            return;
                                        }
                                        flock($fp, LOCK_UN) or die("Cannot Release Lock");
                                        fclose($fp);
                                        $fp=NULL;
                                    }
                                    return $ret;
                            
                                }
                            
                                /* This is the function that writes out the cache */
                                function cache_write($file, $data) 
                                {
                                    $fp=@fopen($file, "w");
                                    if (!$fp) 
                                    {
                                        cache_debug("Failed to open for write out to $file");
                                        return FALSE;
                                    }
                                    fwrite($fp, $data, strlen($data));
                                    fclose($fp);
                                    return TRUE;
                                }
                            
                                /* This function reads in the cache */
                                function cache_read($file) 
                                {
                                    $fp=@fopen($file, "r");
                                    if (!$fp) 
                                    {
                                        return NULL;
                                    }
                                    flock($fp, LOCK_SH);
                                    $buff="";
                                    while (($tmp=fread($fp, 4096))) 
                                    {
                                        $buff.=$tmp;
                                    }
                                    fclose($fp);
                                    return $buff;
                                }
                            
                                function cache_storage($cacheobject) 
                                {
                                    return CACHE_DIR . "/" . $cacheobject;
                                }
                            
                                /* Cache garbage collection */
                                function cache_gc() 
                                {
                                    $cache_dir=CACHE_DIR;
                                    cache_debug("Running gc");
                                    $dp=opendir($cache_dir);
                                    if (!$dp) 
                                    {
                                        cache_debug("Error opening $cache_dir for cleanup");
                                        return FALSE;
                                    }
                                    while (!(($de=readdir($dp))===FALSE)) 
                                    {
                                        // To get around strange php-strpos, add additional char
                                        if (strpos(" $de", "jpcache-")==1)
                                        {
                                            $absfile=$cache_dir . "/" . $de;
                                            $cachestuff=cache_read($absfile);
                                            $thecache=unserialize($cachestuff);
                                            if (is_array($thecache)) 
                                            {
                                                if ($thecache["cachetime"]!="0" && $thecache["expire"]<=time()) 
                                                {
                            						cache_lock($absfile, TRUE);                        
                                                    if (@unlink($absfile)) 
                                                    {
                                                        cache_debug("Deleted $absfile");
                                                    } 
                                                    else 
                                                    {
                                                        cache_debug("Failed to delete $absfile");
                                                    }
                            						cache_lock($absfile, FALSE);                        
                                                } 
                                                else 
                                                {
                                                    cache_debug("$absfile expires in " . ($thecache["expire"]-time()));
                                                }
                                            } 
                                            else 
                                            {
                                                cache_debug("$absfile is empty, being processed in another process?");
                                            }
                                        }
                                    }
                                }
                            
                                /* Caches $object based on $key for $cachetime, will return 0 if the object has expired 
                                   or the object does not exist. */
                                function cache($cachetime, $object, $key=NULL) 
                                {
                                    global $cache_absfile, $cache_file, $cache_data, $gzcontent, $CACHE_ON;
                                    
                                    if (!$CACHE_ON) 
                                    {
                                        cache_debug("Not caching, CACHE_ON is off");
                                        return 0;
                                    }
                                    
                                    $curtime=time();
                                    $cache_file=$object;
                                    
                                    // Make it a valid name
                                    $cache_file=eregi_replace("[^A-Z,0-9,=]", "_", $cache_file);
                                    $key=eregi_replace("[^A-Z,0-9,=]", "_", $key);
                                
                                    cache_debug("Caching based on OBJECT=$cache_file KEY=$key");
                                            
                                    $cache_file="jpcache-" . $cache_file . ":" . $key;
                                    
                                    $cache_absfile=cache_storage($cache_file);
                                    
                                    // Can we access the cache_file ?
                                    if (($buff=cache_read($cache_absfile))) 
                                    {
                                        cache_debug("Opened the cache file");
                                        $cdata=unserialize($buff);
                                        if (is_array($cdata)) 
                                        {
                                            $curco=$cdata["cache_object"];
                                            if ($curco!=$cache_absfile) 
                                            {
                                                cache_debug("WTF?! That is not my cache file! got=$curco wanted=$cache_absfile");
                                            }
                                            else 
                                            {
                                                if ($cdata["cachetime"]=="0" || $cdata["expire"]>=$curtime) 
                                                {
                                                    // data not yet expired (or never expiring)
                                                    
                                                    $expirein=$cdata["expire"]-$curtime+1;
                                                    cache_debug("Cache expires in $expirein");
                                                    
                                                    // restore variables
                                                    if (is_array($cdata["variables"])) 
                                                    {
                                                        foreach ($cdata["variables"] as $k=>$v) 
                                                        {
                                                            cache_debug("Restoring variable $k to value $v");
                                                            $GLOBALS[$k]=$v;
                                                        }
                                                    }
                                                    
                                                    // restore gzcontent
                                                    cache_debug("Restoring gzipped content");
                                                    $gzcontent = $cdata["gzcontent"];
                                                    
                                                    $ret=$expirein;
                                                    if ($cdata["cachetime"]=="0") 
                                                    {
                                                        $ret="INFINITE";
                                                    }
                                                    jpcache_reset();
                                                    return $ret; 
                                                }
                                            }
                                        }
                                    } 
                                    else 
                                    {
                                        // No cache file (yet) or unable to read
                                        cache_debug("No previous cache of $cache_absfile or unable to read");
                                    }
                                    
                                    // If we came here: start caching!
                                    
                                    // Create the file for this page and lock it
                                    $oldum=umask();
                                    umask(0022); 
                                    if (@readlink($cache_absfile)) 
                                    {
                                        cache_debug("$cache_absfile is a symlink! not caching!");
                                        $cache_absfile=NULL;
                                    } 
                                    else 
                                    {
                                        cache_debug("Created $cache_absfile, waiting for callback");
                                        @touch($cache_absfile);
                                        cache_lock($cache_absfile, TRUE);
                                    }
                                    umask($oldum);
                                    
                                    // Set expire and cachetime
                                    $cache_data["expire"]=$curtime + $cachetime;
                                    $cache_data["cachetime"]=$cachetime;
                                   
                                    return 0;
                                }
                            
                                /* Does the actual caching */
                                function writecache($gzcontent)
                                {
                                    global $cache_absfile, $cache_data, $cache_variables, $CACHE_ON;
                                    
                                    if (!$CACHE_ON) 
                                    {
                                        cache_debug("Not caching, CACHE_ON is off");
                                        return 0;
                                    }
                                    
                                    if ($cache_absfile!=NULL)
                                    {
                                        $variables=array();
                                        foreach ($cache_variables as $vn) 
                                        {
                                            if (isset($GLOBALS[$vn])) 
                                            {
                                                $val=$GLOBALS[$vn];
                                                cache_debug("Setting variable $vn to $val");
                                                $variables["$vn"]=$val;
                                            }
                                        }
                                        // Fill cache_data
                                        $cache_data["gzcontent"]=$gzcontent;            
                                        $cache_data["cache_object"]=$cache_absfile;
                                        $cache_data["variables"]=$variables;
                                        $datas=serialize($cache_data);
                                        // write data
                                        cache_write($cache_absfile, $datas);
                                        // unlock cachefile
                                        cache_lock($cache_absfile, FALSE);
                                    }
                                }
                            
                                /* getEncoding() 
                                 *
                                 * Are we capable of receiving gzipped data ?
                                 * Returns the encoding that is accepted. Maybe additional check for Mac ?
                                 */
                                function getEncoding()
                                { 
                                    global $HTTP_ACCEPT_ENCODING;
                                    if (headers_sent() || connection_aborted())
                                    { 
                                        return 0; 
                                    } 
                                    if (strpos($HTTP_ACCEPT_ENCODING,'x-gzip') !== false)
                                    {
                                        return "x-gzip";
                                    }
                                    if (strpos($HTTP_ACCEPT_ENCODING,'gzip') !== false)
                                    {
                                        return "gzip";
                                    }
                                    return 0; 
                                }
                            
                                /* jpCacheInit()
                                 *
                                 * Checks some global variables and might decide to disable caching
                                 * and calls appropriate initialization-methods
                                 */
                                function jpCacheInit()
                                {
                                    global $CACHE_TIME, $CACHE_ON, $CACHE_POST, $HTTP_POST_VARS, $cachetimeout;
                            
                                    // Override default CACHE_TIME ?
                                    if (isset($cachetimeout))
                                    {
                                        $CACHE_TIME=$cachetimeout;
                                    }
                            
                                    // Force cache off when POST occured when you don't want it cached
                                    if (!$CACHE_POST && (count($HTTP_POST_VARS) > 0)) 
                                    {
                                        $CACHE_ON = 0;
                                        $CACHE_TIME = -1;
                                    }
                                    
                                    // A cachetimeout of -1 disables writing, only ETag and content encoding if possible
                                    if ($CACHE_TIME == -1)
                                    {
                                        $CACHE_ON=0;
                                    }
                                    
                                    // Reset cache
                                    jpcache_reset();
                                    
                                    // Output header to recognize version
                                    $version = VERSION;
                                    header("X-Cache: jpcache v$version");
                                }
                            
                                /* jpCacheGC()
                                 *
                                 * Handles the garbagecollection call
                                 */
                                function jpCacheGC()
                                {
                                    // Should we garbage collect ?
                                    if (CACHE_GC>0) 
                                    {
                                        mt_srand(time(NULL));
                                        $precision=100000;
                                        $r=(mt_rand()%$precision)/$precision;
                                        if ($r<=(CACHE_GC/100)) 
                                        {
                                            cache_gc();
                                        }
                                    }
                                }
                            
                                /* jpCacheStart()
                                 *
                                 * Sets the handler for callback
                                 */
                                function jpCacheStart()
                                {
                                    global $CACHE_TIME, $gzcontent, $size, $crc32;
                            
                                    // Initialize cache
                                    jpCacheInit();
                               
                                    // Check cache
                                    if ($et=cache_all($CACHE_TIME))
                                    {
                                        // Cache is valid: flush it!
                                        print jpCacheFlush($gzcontent, $size, $crc32);
                                        exit;
                                    }
                                    else
                                    {
                                        // if we came here, cache is invalid: go generate page 
                                        // and wait for jpCacheEnd() which will be called automagicly
                                        
                                        // Check garbagecollection
                                        jpCacheGC();
                                        // Go generate page and wait for callback
                                        ob_start("jpCacheEnd");
                                        ob_implicit_flush(0);
                                    }
                                }
                            
                                /* jpCacheEnd()
                                 *
                                 * This one is called by the callback-funtion of the ob_start
                                 */
                                function jpCacheEnd($contents)
                                {
                                    cache_debug("Callback happened");
                                    global $size, $crc32, $USE_GZIP;
                            
                                    $size = strlen($contents);
                                    $crc32 = crc32($contents);
                                    
                                    if ($USE_GZIP) 
                                    {
                                        $gzcontent = gzcompress($contents, 9);
                                    } 
                                    else 
                                    {
                                        $gzcontent = $contents;
                                    }
                                    
                                    // cache these thingies, as they are on original content
                                    // which is lost after this
                                    cache_variable("size");
                                    cache_variable("crc32");
                                    
                                    // write the cache
                                    writecache($gzcontent);
                                    
                                    // Return flushed data
                                    return jpCacheFlush($gzcontent, $size, $crc32);
                                }
                            
                                /* jpCacheFlush()
                                 *
                                 * Responsible for final flushing everything.
                                 * Sets ETag-headers and returns "Not modified" when possible
                                 *
                                 * When ETag doesn't match (or is invalid), it is tried to send
                                 * the gzipped data. If that is also not possible, we sadly have to
                                 * uncompress (assuming $USE_GZIP is on)
                                 */
                                function jpCacheFlush($gzcontents, $size, $crc32)
                                {
                                    global $HTTP_SERVER_VARS, $USE_GZIP;
                                    
                                    // First check if we can send last-modified
                                    $myETag = "\"jpd-$crc32.$size\"";
                                    header("ETag: $myETag");
                                    $foundETag = stripslashes($HTTP_SERVER_VARS["HTTP_IF_NONE_MATCH"]);
                                    $ret = NULL;
                                    
                                    if (strstr($foundETag, $myETag))
                                    {
                                        // Not modified!
                                        header("HTTP/1.0 304");
                                    }
                                    else
                                    {
                                        // Are we gzipping ?
                                        if ($USE_GZIP) 
                                        {
                                            $ENCODING = getEncoding(); 
                                            if ($ENCODING) 
                                            { 
                                                // compressed output: set header
                                                header("Content-Encoding: $ENCODING");
                                                $ret =  "\x1f\x8b\x08\x00\x00\x00\x00\x00";
                                                $ret .= substr($gzcontents, 0, strlen($gzcontents) - 4);
                                                $ret .= pack('V',$crc32);
                                                $ret .= pack('V',$size);
                                            } 
                                            else 
                                            {
                                                // Darn, we need to uncompress :(
                                                $ret = gzuncompress($gzcontents);
                                            }
                                        } 
                                        else 
                                        {
                                            $ret=$gzcontents;
                                        }
                                    }
                                    return $ret;
                                }
                            
                                jpCacheStart();
                            ?>

                            Kommentar


                            • #15
                              Hast Du ZLIB enabled?
                              Code:
                              jpcache v1.1.1
                              [url]http://www.weirdpier.com/jpcache/[/url]
                              
                              Copyright 2001 Jean-Pierre Deckers <jpcache@weirdpier.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
                                    
                                [b]Requirements:
                                  - PHP4.0.1+ with Zlib enabled
                                  - MySQL when using the sql-version[/b]
                              
                                Release-notes for v1.1.1:
                                  - Now compatible with php 4.0.5
                                    
                                File vs. sql-storage:
                                  Although the file-storage seems to be faster, you might prefer the 
                                  sql-version, as it has much faster garbagecollection.
                              
                                Installation and usage:
                                  0) Decide whether to go for the file- or database-storage. Read
                                     'jpcache-sql.php' for 'jpcache.inc' when using database-storage.
                                  1) Edit jpcache.inc and change the configurationsettings
                                  2) 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.
                                  3) Start your php-file with <? $cachetimeout=<X>; include "jpcache.inc" ?>
                                     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.
                                   
                                Jean-Pierre 'Pier' Deckers

                              Kommentar

                              Lädt...
                              X