Re: cache_lite cleanup problem
| From: | Pierre | Date: | Wed, 24 May 2006 21:07:28 +0000 |
| Subject: | Re: cache_lite cleanup problem | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-24143@lists.php.net to get a copy of this message | ||
On 5/23/06, Jason Chancellor <jc_groups@aoasoftware.com> wrote:
I'm struggling to figure out what I'm doing wrong as it appears for some reason my lifeTime option is not working properly. I am testing on a Windows XP box running PHP 5.0.4 and running cache_lite version 1.7.1 All I want to do is create a save a cache file, and then after 10 seconds, the cache file goes away. However, in this example I am posting, my cache file never goes away (although it does get saved and accessed properly). My understanding was that on the "get" function it would cleanup the cache file if it had passed its expiration. Anyone know what I'm doing wrong here?Yes, the get method will check the expiration. Do you mean that you never reached "Cache Miss"? --Pierre The code
//-----------
require_once "Cache/Lite.php";
$options = array(
'cacheDir' => "c:/temp/results/",
'lifeTime' => 10,
'pearErrorMode' => CACHE_LITE_ERROR_DIE,
'automaticSerialization' => TRUE,
'automaticCleaningFactor' => 2
);
$cache = new Cache_Lite($options);
//Save the cache
if (isset($_REQUEST["save"]))
{
$cache->save("hi", "CACHEABC", "GROUP123");
print "Saved"."<br>";
return;
}
//Print out cache
if ( $cacheData = $cache->get("CACHEABC", "GROUP123") )
{
print "Cache Hit: ".$cacheData."<br>";
}
else
{
print "Cache Miss"."<br>";
}
--
PEAR General Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php