keldorn Posted December 17, 2009 Share Posted December 17, 2009 I installed Memcached from memcached.org and installed this tutorial. http://blog.ajohnstone.com/archives/installing-memcached/ So I do this, <?php $memcache = new Memcache; $memecache->connect("localhost",11211); $foo = $memcache->("obj:foo"); if(!$foo){ $foo = mysql_query("SELECT * FROM `foo` LIMIT 0,10"); $foo = mysql_fetch_assoc($foo); if(is_array($foo){ $memcache->add("obj:foo",$foo,false,600); } } That set it too expire in 600 seconds or 10 minutes. So I updated Foo, and waited for 10 minutes and refreshed the page, but still showing the old memcache object. I even waited a few more minutes, still showing the old object. I had to delete that key and reset it to show the update. What the heck is wrong with the expire? It doens't work like that? I'm also getting confused because of this, http://www.php.net/manual/en/book.memcache.php http://www.php.net/manual/en/book.memcached.php Quote Link to comment https://forums.phpfreaks.com/topic/185420-memcached-not-expiring/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.