Is this the pecl/memcache client? If so:
$o_memcache->set('key', $data, $flags, 60); # expires in a minute. Something is backwards/wrong/weird, you can narrow this down yourself by: - boiling down manual code snippits as far as you can until it works. Write a small php script that just uses the pecl/memcache interface and try it. If you can get it working, work your way back up. - restart memcached in the foreground with -vv and watch to see that the sets are happening correctly - or avoid the above and use tcpflow/tcpdump to watch for the raw 'set' commands. they should look like: set foo 0 60 13 for no flags, 60 second timeout, 13 bytes, etc. Explaining the script won't help, since this is probably a code bug, you'll need to either share the whole program or just iterate your way down through the code until you make it work :) -Dormando > Well a snippts :) > Let me explain the script: > We are using smarty an get the HTML-Code (whole site) in a variable > ($s_html). > By using the URL we create a unique key (less than 200 characters). > Now we check, if the key is already saved > > # $sCacheFile = unique key! > $s_html_cache = $o_memcache->get($sCacheFile); > if($s_html_cache !== false) > echo $s_html_cache; > else > $o_memcache->set($sCacheFile,$s_html,60*60*6); > > --> 60*60*6 = 6h (also tried 21600, time()+21600) > > After the GET and SET (tried "ADD" too) we check the result code by > using > $o_memcache->getResultCode(); > > The result code returns 0 (success) or 7 (?) or 1 (?) or 16 (by using > GET). > > Need more infos? > Thanks for helping! > > Jean Michel >