Jump to content

Memcached not expiring


keldorn

Recommended Posts

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, :suicide:

 

http://www.php.net/manual/en/book.memcache.php

http://www.php.net/manual/en/book.memcached.php

 

 

Link to comment
https://forums.phpfreaks.com/topic/185420-memcached-not-expiring/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.