Re: Using Pear Cache

From: Date: Wed, 26 Dec 2001 02:24:19 +0000
Subject: Re: Using Pear Cache
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-634@lists.php.net to get a copy of this message
Hello, Andreas Otto wrote: > > Hi all and Merry Christmas, > > I just came across a quite strange behaviour while trying to use the Pear > Chache. > > Every file I call will display will display the content of the first file I > have called. > > E .g. file 1 ouputs "Hello World" and file 2 outputs "Hello Andreas". If I > call file 1 for the first time, the ouput is the expected "Hello World" if I > call file 1 a second time the expected output is again "Hello World". But if > I call file 2 now the ouput is "Hello World" as well which seems a bit odd to > me. > > Since the Pear Cache is working for other people I must have done something > wrong. I would therfore very much appreaciate it if someone could have a look > at the two attached examples. I don't know if that is the reason for your problem, but PEAR cache to file class does not seem to lock cache files to prevent concurrent cache updating. You may want to look into this simpler cache class (it is just a single class file, not a bunch of classes that you need to load) that does file locking properly and it has been succesfully used in the PHP Classes repository site, which is a very busy site, to cache the content of pages with great efficiency. You may find a usage example in the actual documentation HTML page. http://phpclasses.upperdesign.com/browse.html/package/313 Regards, Manuel Lemos

« previous php.pear.general (#634) next »