0

I cannot find info about it on documentation - http://pl1.php.net/manual/en/memcache.set.php, googling also doesn't give much answer.

bool Memcache::set ( string $key , mixed $var [, int $flag [, int $expire ]] )

I understand, that expire param is how long in seconds memcache key is valid. So if I set 2, after two seconds this memcache entry will not be returned, but after one second memcache will return it's data to me.

It's also said, that if set to 0, key is "infinite".

But what when it's set as null? Will memcache read it as 0, so it will be also infinite, or it won't save data at all?

I'm asking, because in Magento, when you want to set block to not caching, you should set 'cache_lifetime' to null (cause when set to false it will be fallbacked to 7200 seconds, and when 0 then it will be infinite). So when using files cache, all is ok, but with memcache, for me it looks it's cached permamently.

gnysek
  • 319
  • 1
  • 15
  • Did you try it? – RiggsFolly Feb 07 '17 at 13:56
  • POssibel duplocate of http://stackoverflow.com/questions/23478588/appengine-memcache-expiration-policies – RiggsFolly Feb 07 '17 at 13:58
  • @RiggsFolly - I don't have memcache locally, but on remote test server it looks, that null is typecasted to 0. That's why I'm asking, as probably only way is to check PHP source code, otherwise I won't get answer. – gnysek Feb 07 '17 at 15:01

0 Answers0