After installing memcache on my EC2 Linux instance using this:
:~$ sudo apt-get install memcached php5-memcache
I can immediately do this:
$memcache = new Memcache;
$memcache->connect('localhost', 11211);
$array_result=$this->db->query("SELECT * where ...."); // some DB query
$memcache->set('my_items', $array_result, false, 60*60*24);
and later can access this cached array like this:
$memcache = new Memcache;
$memcache->connect('localhost', 11211);
$my_items=$memcache->get('my_items');
var_dump($my_items);
My question is what is the Elasticache syntax that correlates with memcache's connect()
, set()
, and get()
commands? I'm totally confused by the Elasticache part of the AWS PHP SDK.