Set ttl and namespace using Memcached in Zend Framework 2
As far as I can figure this seems to be the way to set up Memcached and
set the TTL and Namespace but they have no effect in the cache. The key is
not prefixed with a namespace and the expire is infinite.
$MemcachedResourceManager = new
\Zend\Cache\Storage\Adapter\MemcachedResourceManager(1, new
\Zend\Cache\Storage\Adapter\Memcached());
$MemcachedResourceManager->addServer(1, array('localhost', 11211));
$MemcachedOptions->setResourceManager($MemcachedResourceManager);
$MemcachedOptions->setNamespace('FooBar_');
$MemcachedOptions->setTtl(10);
$cache = $MemcachedOptions->getResourceManager()->getResource(1);
$cache->set('foobar_key','I am in cache');
Does anyone have any tips, clues? Any help would be much appreciated.
No comments:
Post a Comment