We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

ORM with Oracle - 4 queries just to get one record

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



8.4k

what phalcon version you are using

in 4 Phalcon\Mvc\Model\Metadata\Memcacheis removed

check the Upgrade Guide

I have an old version(1.2.6) phalcon, how can achieve this model metadata caching with this version, kindly assist Or any other solution which can suite to this issue.

Thanks in advance,



8.4k

i couldn't find documentation for older than 3.4 sorry

Phalcon has evolved alot since 1.2.6 I highly recommend upgrading to 4 and jump ahead of it

or at least 3.4 until they work out the current issues

It's going to be really hard to get help when you're running 1.2.6. That version is (relatively) ancient.

edited Mar '20

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 mcdvoice..

Thanks in advance

not much familier with this

@SoniaAllison - that's an entirely different question. Please create a new thread instead of a followup on an old, unrelated topic.