Closed googlle closed 8 years ago
There is already a feature in phalcon to cache metadata. You can pick any of the available adapters (filesystem, apc, memcached, memcache, redis and xcache, with some additional ones available on the incubator repo) see https://github.com/phalcon/cphalcon/tree/master/phalcon/mvc/model/metadata
To add metadata caching just add something like this to your services file:
$di->set('modelsMetadata', function () use ($config) {
return new Phalcon\Mvc\Model\MetaData\Files(
['metaDataDir' => $config->application->modelsCacheDir]
);
});
using the adapter of your choice.
@Green-Cat Thank very much
Hello. Can I generate model metadata with this tool? Because I think if we define the metadata in the model - this is faster than every time they request from the database