How can i cache the model metadata using APC, i have followed docs and tried below but its not working, i can see 4 queries running for 1 select statement (i mean Model:find())
$di['modelsMetadata'] = function() {
$metaData = new \Phalcon\Mvc\Model\MetaData\Apc(array(
"lifetime" => 3600,
"prefix" => "my-model-cache"
));
return $metaData;
};
If i try with memcache application is not running
$di->set( 'modelsMetadata', function () { new \Phalcon\Mvc\Model\Metadata\Memcache( [ "prefix" => "my-model-cache", "lifetime" => 86400, "host" => "localhost", "port" => 11212, "persistent" => false, ] ); } );
its giving 500 internal error
can anyone guide me in this..
Thanks in advance