Adam
Adam

Reputation: 20892

AWS Elasticache + set()

I can get .set() to work when interacting with Elasticache if I use the compression & time settings (third and forth settings)

 $memcached = new Memcached();
 $memcached->setOption(Memcached::OPT_CLIENT_MODE, Memcached::DYNAMIC_CLIENT_MODE);
 $memcached->addServer('goneglobalcache-1a.expalp.cfg.apse1.cache.amazonaws.com', 11211);
 $memcached->set('key', 'value', 60);

 $memcached->set('tester', 'set tester...', 0, 600);
 echo $memcached->get('tester');

If I remove the last 2 elements of the set() it does work eg:

 $memcached->set('tester', 'set tester...');
 echo $memcached->get('tester');

This is the first time I've used memcached/elasticache - would there be any reason why this would fail. Note: add() works as well so long as I only use the key/value parts and not the compression/time parts.

any advice?

thx

Upvotes: 0

Views: 1317

Answers (1)

epicdev
epicdev

Reputation: 922

public bool Memcached::set ( string $key , mixed $value [, int $expiration ] )

There is no compression flag in the set method, it's in Memcache not Memcached.

$memcached->set('tester', 'set tester...', 600);

Upvotes: 1

Related Questions