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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.