Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3437464
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:04:07+00:00 2026-05-18T08:04:07+00:00

I am disappointed with memcached. Working with it has been far from easy. An

  • 0

I am disappointed with memcached. Working with it has been far from easy.

An example:

$memcache = new Memcache;
$memcache->connect('127.0.0.1', 11211) or die ("Could not connect");

$memcache->set('id', $array, 120);

I set this about an hour ago – and it is still there! The manual says can use the “number of seconds starting from current time” as parameter. So why is the expiry ignored?

Another thing that bugs me is that sometimes values are not written. It all is pretty much random.
“argyleblanket” mentioned running into those problems in the php manual:
http://www.php.net/manual/en/memcache.set.php#84032
I have implemented that fallback on all my replace() calls as well. I don’t get why it won’t just work on the first call. Why offer a replace() function if it’s in the stars if it replaces the content or not?

The question is why would I trust such a software to do anything of importance
and is there a way to make it more reliable?

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T08:04:07+00:00Added an answer on May 18, 2026 at 8:04 am

    You’re using wrong syntax. The 3rd parameter is the compression flag.

    Make a simple interface such as this following. It can help you:

    /* defines params */
    define('MEMCACHED',     1);
    define('CACHE_DEFAULT_EXPIRE',  3600);
    
    if(MEMCACHED) if(! class_exists('memcached')) die('memcache not loaded');
    
    /* Cache */
    if(MEMCACHED) { 
        global $memcache;
        $memcache = new Memcache();
        $memcache->connect('127.0.0.1', 11211);
    }
    
    function cacheSet($key, $var, $expire=NULL) {
        if(!MEMCACHED) return 0;
        global $memcache;
        if(!$expire) $expire = CACHE_DEFAULT_EXPIRE;
        $key = md5($key);
        return $memcache->set($key, $var, false, $expire);
    }
    
    function cacheGet($key) {
        if(!MEMCACHED) return 0;
        global $memcache;
        $key = md5($key);
        return $memcache->get($key);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm disappointed in seeing that no DB support has been added to the new
I got rejected from CodeCanyon just a few minutes ago and I'm kinda disappointed,
Coming from Eclipse, I'm disappointed with the very limited syntax coloring capabilities offered for
New OScommerce user. I've been fiddling around with Chemo's Ultimate SEO add-on the last
I have been seriously disappointed with WPF validation system. Anyway! How can I validate
I had 2 BroadcastReceivers for watching SMS status. Code: //---when the SMS has been
I've been working with web-forms and I want to switch to the MVC pattern
I was wondering if anyone has any tips on transitioning from PHP to asp.net
I'm disappointed that dart doesn't feature weak references. Is there something about compiling to
It's a bit late, but I'm disappointed in myself for not coming up with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.